Thinkphp_ template operation

Source: Internet
Author: User

Shortcut output variables

    1. {: function (...)} Executes the method and outputs the return value
    2. {~function}//execution method does not output
    3. {@var}//Output session variable
    4. {#var}//Output cookie variable
    5. {&var}//Output configuration parameters
    6. {%var}//Output language variable
    7. {. var}//Output get variable
    8. {^var}//Output post variable
    9. {*var}//Output constant
Copy Code

Template output

    1. 1 call the index action template directly
    2. $this->display ();
    3. Correspondence myapp/tpl/default/index/index.html
    4. 2 Calling the Test1 action template of the index module
    5. $this->display (' test1 ');
    6. Correspondence myapp/tpl/default/index/test1.html
    7. 2 Calling the Test2 action template of the message module ()
    8. $this->display (' Message:test2 ');
    9. Correspondence myapp/tpl/default/message/test2.html
    10. 3 Test2 action template for the message module that calls the XP topic
    11. $this->display (' Xp@message:test2 ');
    12. Correspondence myapp/tpl/xp/message/test2.html
    13. 4 directly specify the full name of the template file
    14. $this->display ('.. /message/test3.html ');
    15. Correspondence myapp/tpl/default/message/test3.html
Copy Code

  • Related Article

    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: 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.