I have a single controller, Index, that manages several non-specialized informational pages (e.g Homepage, Overview, Features, etc.). Each page has its own action in the controller. Depending on the action, a different View script is used to render the content.
Is it bad practice to use different View scripts to render each action? Should each page have its own controller? Thanks,
What you are describing is actually the standard best practice that Zend Framework MVC implements. That’s how Zend Framework ‘wants’ you to do it! Why are you afraid it could be bad practice?
To your second way of asking…
No, but don’t start thinking from the direction of pages, think in terms of functional units. For example, if your page needs user management, you will most likely have a
userController.What are the functions this controller needs to fulfill?
So each of these functions becomes an action in your userController (function = method = action).
This way, you will automatically have easy to read URLs as well. And finally, every action has a .phtml view script, where the necessary markup for that action resides.