How you will use or load CodeIgniter libraries

devquora
devquora

Posted On: Feb 22, 2018

 

$this->load->library(‘library_name’); method is used to load a library in CodeIgniter.

Usage:
//Loading Cart library

$this->load->library('cart');

Using Cart library methods

$data = array(
        'id'      => 'sku_9788C',
        'qty'     => 1,
        'price'   => 35.95,
        'name'    => 'T-Shirt',
        'options' => array('Size' => 'L', 'Color' => 'Red')
);

$this->cart->insert($data);

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    CodeIgniter Interview Questions

    How to check the version of CodeIgniter framework?

    How to check the version of CodeIgniter framework?..