This article mainly introduces the usage of thinkphp hollow templates and empty modules, and demonstrates the implementation of empty templates and empty modules in the form of examples, generally, empty modules are mostly used when the system cannot find the specified module, such as locating error pages and URL optimization, which has some practical value, this document describes the usage of the thinkphp empty template and empty module. Share it with you for your reference. The specific implementation method is as follows:
1. empty operation
The code is as follows:
Function _ empty ($ name ){
$ This-] show ("$ name does not exist [a href = '/index. php/Index/index'] return to homepage [/a]");
}
2. empty module
The code is as follows:
Class EmptyAction extends Action {
Function index (){
$ City = M ('city ');
$ Arr = $ city-] select ();
$ This-] assign ('list', $ arr );
$ Name = MODULE_NAME; // Obtain the module name in the current address bar
$ This-] display ("City: $ name"); // reference the corresponding module
}
}
I hope this article will help you with ThinkPHP framework programming.