The template page cannot be accessed after the module Group

Source: Internet
Author: User
After the module group, you cannot access the template page. The project directory structure is as follows:
The content in IndexAction. class. php is as follows:
// This class is automatically generated by the system for testing purposes only
Class IndexAction extends Action {
Public function index (){
Header ("Content-Type: text/html; charset = utf-8 ");
Echo 'admin ';
$ This-> display('a.html ');
}
}
The access path is as follows:
Http: // localhost/secondtrade/index. php/Admin/Index/index


Reply to discussion (solution)

7.1 Template definition
To manage template files more effectively, ThinkPHP classifies template files into directories. the default template file definition rules are as follows:
Template directory/[group name/] [template topic/] module name/operation name + template suffix
The template directory is the Tpl under the project by default. when a group is defined, the subdirectories are separated by the group name. The new template topic is empty by default (indicating that the template topic function is not enabled ), the template topic function is designed to switch between multiple templates. if there are multiple template themes, you can use the DEFAULT_THEME parameter to set the default template topic name.
Under each template topic, the project module is named directory, and then the specific operation template file of each module, for example:
The template file corresponding to the add operation of the User module should be: Tpl/User/add.html
The suffix of the template file is .html. you can also configure it as another one through TMPL_TEMPLATE_SUFFIX.
If the project enables the module grouping function (assuming that the User module belongs to the Home group), the default template file may be Tpl/Home/User/add.html.
Of course, the group function also provides the TMPL_FILE_DEPR parameter to simplify the directory hierarchy of the template.
For example, if TMPL_FILE_DEPR is configured as "_", the default template file is changed:
Tpl/Home/User_add.html
Because the system has such a rule for automatic identification of template files, the common display method can output the corresponding template without any parameters.

The location of your template file is incorrect.

So how should we put it? Please answer...

Template directory/[group name/] [template topic/] module name/operation name + template suffix

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.