Problem with library - problem with extending base class maybe? - 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: Problem with library - problem with extending base class maybe? (/showthread.php?tid=3047) |
Problem with library - problem with extending base class maybe? - El Forum - 09-06-2007 [eluser]LeePR[/eluser] I'm having a little problem with a custom library. I have a StateCollection class that extends a Collection class. When I load the StateCollection library, the code in the constructor executes, but when I try to call one of the methods (inherited from Collection), I get an error: Quote:Severity: Notice Is the code in my Collection/StateCollection class at fault? Here's the code... Collection (library): Code: <?php Code: <?php Code: <?php Cheers, LeePR Problem with library - problem with extending base class maybe? - El Forum - 09-06-2007 [eluser]LeePR[/eluser] If I change my view to the following, it still seem to load the library, but chokes on the method call: Code: <?php Quote:A PHP Error was encountered Problem with library - problem with extending base class maybe? - El Forum - 11-20-2007 [eluser]mrkirkland[/eluser] Did you find an answer? Problem with library - problem with extending base class maybe? - El Forum - 11-20-2007 [eluser]Pygon[/eluser] Regarding your first post: __construct shouldn't be declared "public". Also in "StateCollection", you function should be "public function StateCollection", not "Collection". Regarding your second post: $stateCollection isn't the same as $statecollection. --Just the things I noticed off the bat. |