I need to load more than 2 libraries in the CI controller and call their member functions. I tried the following methods, but did not use.
1.
$this->load->library('liba');
$result = $this->liba->SearchTours($searchParams);
echo $result;
$this->load->library('libb');
$result2 = $this->libb->tourFetch($searchParams);
echo $result2;
2.
$this->load->library(array('liba' , 'libb'));
$result = $this->liba->SearchTours($searchParams);
echo $result;
$result2 = $this->libb->tourFetch($searchParams);
echo $result2;
3.
$this->load->library('liba');
$this->load->library('libb');
$result = $this->liba->SearchTours($searchParams);
echo $result;
$result2 = $this->libb->tourFetch($searchParams);
echo $result2;
4.
public function __construct(){
parent::__construct();
$this->load->library('liba');
$this->load->library('libb');
}
- I changed the boot order in 4 cases. Whatever is mentioned, the second one does not load.
In all cases, only the first library mentioned is loaded, and this notification is displayed for the second.
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Unify::$libb
Filename: controllers/Unify.php
Line Number: 30
I could not find a single soul in the CI or SO user guide. What am I doing wrong?
source
share