Unknown
In this tutoral we will Discuss how to load model,library and helper in codeigniter .There are 2 ways to load library, helper and model in codeigniter
autoload.php file
The library key of the config array is used to load the library in the autoload.php
$autoload['libraries'] = array('library_name');
Current controller constructr :
public function __construct()
{
parent::__construct();
$this->load->libraries('library_name');
}
autoload.php file
The helper key of the config array is used to load the helper in the autoload.php
$autoload['helper'] = array('helper_name');
Current controller constructr :
public function __construct()
{
parent::__construct();
$this->load->model('helper_name');
}
autoload.php file
The model key of the config array is used to load the model in the autoload.php
$autoload['model'] = array('model_name');
Current controller constructr :
public function __construct()
{
parent::__construct();
$this->load->model('model_name');
}