Examples of thinkphp empty template and empty module usage

Source: Internet
Author: User
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 U

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 U

This example 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.

,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.