MY_Controller Not Extending? - 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: MY_Controller Not Extending? (/showthread.php?tid=45029) |
MY_Controller Not Extending? - El Forum - 09-05-2011 [eluser]Unknown[/eluser] I've looked at this for an hour and I am really miffed. Can someone help me figure out what I'm missing? I'm trying to extend the CI_Controller to have a method available in all of my other controllers. I have created MY_Controller.php and placed it in my application/core folder. Here are the contents: Code: <?php When I try to call my method (nav_items()) from my other controllers, I get an error that says, "Call to undefined method..." I was curious if this meant that my MY_Controller.php file was not getting loaded. I put some code in it that would cause an error and it did. So, it seems like it's getting loaded, but I can't access any of the methods in it. I tried calling the method using $this->nav_items() and for fun CI_Controller::nav_items() and parent::nav_items().. all don't work. I feel like I have to be missing something obvious, but can't figure it out... Thanks for any help. |