I need to load more than 2 libraries in a CI Controller and call their member functions. I've tried the following ways but no 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 have swapped the order of loading in above 4 cases. Whichever is mentioned second does not load.
In all the cases only the first mentioned library is loaded and this Notice shows for the second one.
A PHP Error was encountered
Severity: Notice
Message: Undefined property: Unify::$libb
Filename: controllers/Unify.php
Line Number: 30
I couldn't find any soultion on CI user manual or SO. What am I doing wrong?