I have some custom functions in 'custom_functions.php' which I call from my controllers.
my 'custom_functions.php' code is like :
class Custom_functions extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('model');
$this->load->library('session');
}
public function data($first, $next) {
// other codes start from here
}
}
I kept that file in application/libraries and loaded in controller:
class Home extends CI_Controller {
public function __construct() {
parent::__construct();
$this->load->model('model');
$this->load->library('pagination');
$this->load->library('custom_functions');
}
// other codes start from here
}
then my custom function worked but the pagination wasn't working.
I get an error message:
A PHP Error was encountered Severity: Notice Message: Undefined property: CI_Loader::$pagination Filename: views/index.php Line Number: 27
While the view file 27th line is:
echo $this->pagination->create_links();
if I remove
$this->load->library('custom_functions');
then the pagination line works. why this happens ? did I do wrong to load my custom function or I kept my custom function in wrong folder ? in which folder should I keep my 'custom_functions.php' file ?