![]() |
Class MY_Controller not found - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Class MY_Controller not found (/showthread.php?tid=28871) Pages:
1
2
|
Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Mareshal[/eluser] I am trying to extend the controller class with this code Code: //controllers/backend/dashboard.php Code: //libraries/MY_Controller What is wrong here? I read a few articles about this, but I fixed those issues. anything else? I am using the CI version from BitBucket, could this be an issue? Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Rob Gordijn[/eluser] If I'm right, the bitbucket version is the latest 'CI 2.0 in development' version. So my guess is that you have found the solution by yourself, your code is flawless. Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Mareshal[/eluser] That code doesn't work in CI 1.7.2 too ![]() LOL, not it works in 1.7.2 , very very strange Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Rob Gordijn[/eluser] ok, strange. thoughts: - are the filesnames correct? (i dont see .php in MY_Controller) - are the files in the same project / application directory? - use parent::__construct() instead of parent::MY_Controller(); in the Dashboard class - errr, running out of clues... Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Mareshal[/eluser] The error is on this line Code: class Dashboard extends MY_Controller MY_Controller has .php for sure, just checked Yes, files are in same application, but I have this pattern: / dev system index.php My application is on the same level with system folder, everything else works. I tried with __construct already, but same code in 1.7.2 works, so there's a problem with 2.0. Just submitted an issue on BitBucket for this Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Rob Gordijn[/eluser] ok, last thought: are you using some kind of extension, hooks, HMVC, custom code or others? try a plain CI install, I use the MY_Controller exactly the same as you, and it just works. Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Phil Sturgeon[/eluser] There was a bug in the core of CodeIgniter 2.0 which would stop MY_Controller being loaded. It has been fixed in the latest "bleeding edge" copy, so just download it again. Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Mareshal[/eluser] [quote author="Phil Sturgeon" date="1269441699"]There was a bug in the core of CodeIgniter 2.0 which would stop MY_Controller being loaded. It has been fixed in the latest "bleeding edge" copy, so just download it again.[/quote] Still not working. Here is the entire version CI core and my application, just download, and test on your localhost Code: http://dl.transfer.ro/codeigniter-transfer_ro-24mar-468eee07.rar If anyone tests it, tell me please Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Phil Sturgeon[/eluser] Well, Greg Aker fixed it his way and I fixed it my way. Does my fork work better? Also, it could be as you are requesting parent::MY_Controller(); which does not exist. Pick MY_Controller or __construct and use it consistently. Class MY_Controller not found - El Forum - 03-24-2010 [eluser]Mareshal[/eluser] same same same. ![]() I think I am going to switch back to 1.7.2 :| |