Controller doesn’t get redefined by MY_Controller |
|||
|---|---|---|---|
| Date: | 03/10/2008 | Severity: | Minor |
| Status: | Bogus | Reporter: | gabe |
| Version: | 1.6.1 | ||
| Keywords: | |||
Description
Making a bug report, because according to the user guide if I create the file system/application/libraries/MY_Controller.php it should redefine Controller.php without making any changes to my site controllers.
I can’t get this to work, and perhaps the way written in the user guide isn’t the right way.
Expected Result
Actual Result
Comment on Bug Report
| Posted by: gabe on 10 March 2008 5:18am | |
|
|
forum uri http://codeigniter.com/forums/viewthread/73469/ |
| Posted by: Sam Dark on 19 March 2008 2:13pm | |
|
|
I think it needs to be explained in user guide. |
| Posted by: Derek Jones on 7 May 2008 5:49pm | |
|
|
Any suggestions for wording? To me this is just understanding OOP with PHP so I’d like to hear some suggestions from those who ran into this problem and didn’t grasp it right away. Something that won’t go over the heads of the people who would benefit from this extra documentation, but not so dumbed down that the user just follows the steps without knowing why, thinking it was something weird with CI. |
| Posted by: gabe on 8 May 2008 2:15am | |
|
|
The user guide led me to believe that I could override and extend functionality of the core class just by creating MY_Controller, but in actual fact I need to do this AND then make sure the controllers I’ve written extend MY_Controller. This is in contrast to something like MY_Output, or any of the helpers - I can create MY_html_helper add some functions, and they will automatically become available without having to alter anything in any other files. On the other hand if I extend Controller, I will need to make sure my controllers inherit from MY_Controller. I think just noting that simply extending Controller won’t work, and you will need to specifically extend MY_Controller in all your site controllers. |
| Posted by: Derek Jones on 8 May 2008 7:56am | |
|
|
Done. |
