That is, the suffix can be defined for the operation method. if the above parameter is configured, the actual operation method we call is to add the operation name with the Run suffix, assume that the URL address we are currently accessing is the defect solution of the TP operation method we mentioned before. now we have a simpler solution in version 3.1, you only need to configure the ACTION_SUFFIX parameter. Obviously, it is much simpler than the behavior extension method. for example:
- 'Action _ SUFFIX '=> 'run'
Copy the code to define the suffix for the operation method. if the above parameter is configured, the actual operation method we call is to add the suffix "Run" to the operation name, assume that the URL we are currently accessing is:
- Http: // localhost/index. php/User/list
Copy the code to access the list operation of the User module. before ACTION_SUFFIX is configured, the list method may conflict with the built-in php method, the actual access should be the listRun method of the UserAction controller:
- Class UserAction extends Action {
- Public function listRun (){
- // Operation method code
- }
- }
Copy the code. of course, you can configure any string as the suffix of the operation method. the configuration parameter of ACTION_SUFFIX does not affect the use of the current operation name, and does not affect the call of Method A and method R. However, it should be noted that the operation name suffix should not conflict with the controller class suffix, otherwise it will be called again.