Name requirement of Controller and Model is different when extending core lib |
I'm trying to extend the original CI_Controller and CI_Model to meet some of my demands. But when I do this, I found that the name requirement of extending these two core libraries is different from each other.
First, I created a file called MY_Controller.php in /application/core, and then create a class whose name does not start with the default required "MY_": PHP Code: class A_Controller extends CI_Controller { You see, though I did not meet the naming requirement (which can be seen here Creating core libraries), it actually works. But it behaves differently when extending CI_Model. If my MY_Model.php is like this: PHP Code: class A_Model extends CI_Model { Codeigniter will throw an error telling me that: Code: Message: /var/www/application/core/MY_Model.php exists, but doesn't declare class MY_Model So is the naming strategy of extending CI_Controller and CI_Molde treated differently ? |
Messages In This Thread |
Name requirement of Controller and Model is different when extending core lib - by dangyuluo - 09-16-2016, 07:28 PM
RE: Name requirement of Controller and Model is different when extending core lib - by InsiteFX - 09-17-2016, 03:23 AM
|