Hello Stackoverflow,
I am quite a new Zend Framework user but I am not new to PHP or Programming. I have been going through the code to try and get to grips with how everything slots together. One of the parts I have been looking at is how classes are Autoloaded in the system. I can see that:
- Zend_Application_Bootstrap references Zend/Application/Bootstrap.php
- Zend_Controller_Action references Zend/Controller/Action.php
- ... etc etc
Essentially _ get converted to the directory sepearator and get autoloaded.
What I don't understand (although im sure there is a good reason) is why this convention isn't followed for action controllers?
- IndexController references Application/controllers/IndexController.php
Why not:
- Application_Controllers_Index -> /Application/Controllers/Index.php
- or
- Controllers_Index -> /Application/Controllers/Index.php
?
I am guessing giving the class a suffix reduces some complexity in the system somewhere, from first looks at the zend framework everything is very well thought out - I cannot imagine conventions are introduced without good reason.
Can anyone explain why controllers are prefixed, or even better point me to some code in the core showing why they have to be prefixed?
Thanks :)