1. Controller operation
(config) ' action_suffix ' = ' abc ',//Add Controller method suffix to prevent collisions
Public Function Indexabc () {//followed by the ABC suffix
}//url:index will be all right.
2. Internal calls
/*//Internal call
Public Function User() {
$userEvent =new userevent(); Internal modules
$userEvent,use R (); Method
*/
/*//Internal Call
$userEvent =a ('User', 'Event'); Internal modules
$userEvent-user(); Method
*/
}
3. Pre-and post-execution
Pre-execute plus prefix _before
Public Function _before_index () {
Echo ' Front ';
}
Post-execution prefix _after
Public Function _after_index () {
Echo ' after ';
}
4. Multilevel Controller
Allow level two connections
(config)//' Controller_level ' =>2,
When open two level, the level can not be used, do not open two, level two can not be used
Create a second controller in the controller.
5. Jump and return
Public Function User () {
$fiag =true;
if ($flag) {
Jump to
$this->success (' New success ', ' ... /kzhiq/all ');
}
else{
Jump to
$this->error (' new failure ');
}
}
Public Function All () {
Echo ' WCL ';
}
}
On the thinkphp-controller