I would like, for my model classes, that instead of having to name them “Default_Model_Class1”, they would be simply named “Class1”.
I can’t find a way to do that.
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The answer? By Cheating.
If you have all your models in, let’s say, application/models, you can add that path to your include path and set Zend’s autoloader to fallback when it cannot find based on good naming practices (see KingCrunch’s comment)
To tell the autoloader to fallback:
Then when you try to load YourModel which resides in your models path, the autoloader should be able to handle it and you can build your references using the simple names.
Even though your application is small, it’s always good to use those best practices.