Each module is an action file, so an important process in application development is to define specific actions for different modules. An application that doesn't need to define a model class when it doesn't need to interact with the database, but must define the action controller, which is typically located under the Lib/action directory of the project.
the definition of the action controller is simple, as long as you inherit the action base class, for example:
Li class= "L0" style= "padding:0px 5px; margin:0px; border-left-width:1px; Border-left-style:solid; Border-left-color:rgb (209,215,220); line-height:23px; Background-color:rgb (250,250,250) "> Class   useraction extends   Action {}
the name of the controller file is UserAction.class.php.
if we want to execute the following URL
Http://localhost/App/index.php/User/add
You need to add an add operation method, for example
the name of the controller file is UserAction.class.php.
if we want to execute the following URL
Http://localhost/App/index.php/User/add
You need to add an add operation method, for example
<?php// user Module class Useraction extends action{ //Define an Add action method public function Add () { // Implementation of the Add Action method logic //... $this->display ();//Output page template } }
The action method must be defined as the public type, or an error will occur. Also note that the name of the action method is not duplicated with the method of the built-in action class. The template file for the current operation is automatically positioned, and the default template file should be located under the project directory
tpl\user\add.html
Custom Controller method under thinkphp framework