In my understanding, each function module is divided into a controller. In this way, when requirements change in the future, the modification does not affect other modules as much as possible, but some people say that all the methods of the output view are extracted and written to the IndexController controller separately, while Ind... in my understanding, each function module is divided into a controller. In this way, when requirements change in the future, the modification will not affect other modules as much as possible.
However, it is also said that all the methods of the output view are extracted and written to the IndexController controller, and the IndexController then calls the methods of other controllers. It seems that what they said makes sense.
However, if there is a change in demand in the future, the IndexController controller should also be modified, as if it violates the principle of high cohesion and low coupling. (The output view and data processing under the same function should be in the same controller)
I don't know how to divide controllers. Can anyone share their division methods and specifications.
Reply content:
In my understanding, each function module is divided into a controller. In this way, when requirements change in the future, the modification will not affect other modules as much as possible.
However, it is also said that all the methods of the output view are extracted and written to the IndexController controller, and the IndexController then calls the methods of other controllers. It seems that what they said makes sense.
However, if there is a change in demand in the future, the IndexController controller should also be modified, as if it violates the principle of high cohesion and low coupling. (The output view and data processing under the same function should be in the same controller)
I don't know how to divide controllers. Can anyone share their division methods and specifications.
Currently, thinkphp is used together in two ways.
.
| -- Login
| '-- Action
| -- IndexAction. class. php
| '-- LoginAction. class. php
| -- Query
| '-- Action
| -- AgentChargeLogAction. class. php
| -- AgentFundsLogAction. class. php
| -- IndexAction. class. php
| -- MobileTelAction. class. php
| -- OrderQueryAction. class. php
| -- ProductAction. class. php
| '-- UserAction. class. php
| -- Trade
| '-- Action
| -- CardlibAction. class. php
| -- FlowAction. class. php
| -- IndexAction. class. php
| -- QcoinsAction. class. php
| '-- TelAction. class. php
Each functional module divides a directory.
Extract all the methods of the output View to the IndexAction (Version 3.1) controller, and then call the methods of other controllers in the IndexAction controller.
It is recommended that a function module be a controller or a folder. This makes maintenance and modification easy.