Template output in the ThinkPHP Project Group

Source: Internet
Author: User
When you use the $ this-& gt; display () command to output the default template, the output template path is added with the group name: template output

After the project group is enabled, the template output path is different from the original one.
Default output

When you use $ this-> display ()
When the default template is output, the output template path is added with the group name:

TPL/template default topic/group name/module name/operation name + template suffix




  1. // Example:
  2. Tpl/default/Admin/User/view.html

Because the project group name is added to the output template path, the corresponding template directory also changes. for details, refer to ThinkPHP
Project Group Directory structure description.
Templates that output other operations of the current module

The format remains unchanged:

$ This-> display ('Operation name ');

Outputs other modules and Operation templates of the current group project

Format:




  1. $ This-> display ('Module name: Operation name ');
  2. // Or:
  3. $ This-> display ('Module name/operation name ');
  4. // Example:
  5. $ This-> display ('Article/add ');

Output other group Project templates

Format:




  1. $ This-> display ('group name: module name: Operation name ');
  2. // Or:
  3. $ This-> display ('group name: module name/operation name ');
  4. // Example:
  5. $ This-> display ('Home: Article/read ');

  6. $ This-> success ()

For built-in systems:

$ This-> success ();
$ This-> error ();

The template corresponding to these two operations is success.html(error.html) under the Tpl/default/Public directory ).

Read more

ThinkPHP
Template output display method

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.