Hello,
I made my first project with ZF, used the Zend_Tool component. For the index controller a created some actions, and they work well. But my question is, when do you create a new controller? thanks!
Hello,
I made my first project with ZF, used the Zend_Tool component. For the index controller a created some actions, and they work well. But my question is, when do you create a new controller? thanks!
When you want to have a different page. Are you using different logic or trying to fulfil a completely different task?
It should be quite clear to you when you want to create a new Controller, it is because you are doing something completely different.
As the Controller is a crucial part of the MVC pattern, I suggest reading up a bit on this.
In a nutshell:
The controller receives input and initiates a response by making calls on model objects.
So when to create a new controller totally depends on your application. Often, there is one controller per database table in your model. The controller usually would allow for handling CRUD requests and delegating them to your model to process them.
Check out