![]() |
There's limit for loaded libraries? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: There's limit for loaded libraries? (/showthread.php?tid=56865) |
There's limit for loaded libraries? - El Forum - 01-26-2013 [eluser]Unknown[/eluser] Hello, I'm with a big problem, I have a controller managing all "profile user"(e.g.: save, update,...) and this controller loads 3 models and 3 libraries inside the constructor. The problem is: When I load a new library in some function of this class the system returns this error(independent of which class I want to load) : Quote:A PHP Error was encountered If I load the library in "autoload.php" it works, but I can't load all libraries there... I have no idea what is happening. the constructor: Code: public function __construct() This is a bug or some problem with my code? Can someone help me? Thanks There's limit for loaded libraries? - El Forum - 01-26-2013 [eluser]Unknown[/eluser] Try with: $this->load->library(array('lib1','lib2','libN')); I don't know what cause the problem, but I think everything is gonna be alright with this code There's limit for loaded libraries? - El Forum - 01-26-2013 [eluser]Unknown[/eluser] Hi Plamba95, I've tried it and didn't works. But you with this give an idea and I found the issue. I created my own library like this: Code: class LoginVerifica extends CI_Controller { I read this documentation: http://ellislab.com/codeigniter/user-guide/general/creating_libraries.html and I saw my mistake, my class was extending to "controller" and had a constructor, I've changed to this: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); And now it's working loading multiple libraries. Thanks ![]() There's limit for loaded libraries? - El Forum - 01-26-2013 [eluser]InsiteFX[/eluser] Try adding this to your Constructor affter everything else: Code: parent::__construct(); There's limit for loaded libraries? - El Forum - 01-26-2013 [eluser]Aken[/eluser] parent::__construct() should be first. |