Extending Base Libraries via. "Packages" - 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: Extending Base Libraries via. "Packages" (/showthread.php?tid=38480) |
Extending Base Libraries via. "Packages" - El Forum - 02-09-2011 [eluser]Unknown[/eluser] Version: CI 2.0 (Default Install) Hi, I am experiencing unexpected results. It seems that you cannot extend base libraries through packages. In my particular instance I was trying to extend form_validation class. Since this is not a core class It must be stored in the ./application/libraries. My attempt at storing it in ./package_path/libraries was unsuccessful. Here is my final solution to the issue, however I feel it is more off a hack than a solution. Code: //I included the class myself And here is my controller Code: class PAGE_EXAMPLE extends CI_Controller { Let me know what you guys think Thanks, Kwaight Extending Base Libraries via. "Packages" - El Forum - 02-09-2011 [eluser]WanWizard[/eluser] You can extend a library though a package, only the 'autoloading' of the extended class doesn't happen as you have discovered. A cleaner solution might be to extend the loader library so that it looks in packages as well? |