Home >Backend Development >PHP Tutorial >Thinkphp framework template variables and template output_PHP tutorial

Thinkphp framework template variables and template output_PHP tutorial

WBOY
WBOYOriginal
2016-07-12 09:07:231084browse

Thinkphp framework template variables and template output

Thinkphp framework
Template operation variable output:
{:function(…)}        //执行方法并输出返回值
{~function}         //执行方法不输出
{@var}                 //输出Session变量
{#var}                 //输出Cookie变量
{&var}                 //输出配置参数 
{%var}                 //输出语言变量
{.var}                 //输出GET变量
{^var}                 //输出POST变量
{*var}                 //输出常量

Template output
//1 Directly call the default (index) operation template
$this->display();
// Corresponds to Winxin/Tpl/default/Index/index.html
//2 Call the test1 operation template of the Index module
$this->display('test1');
//Corresponds to Winxin/Tpl/default/Index/test1.html
//2 Call the mes operation template() of the Message module
$this->display('Message:mes');
//Corresponds to Weixin/Tpl/default/Message/mes.html
//3 Call the test2 operation template of the Message module of the XP theme
$this->display('Xp@Message:test2');
//Corresponds to Weixin/Tpl/Xp/Message/test2.html
//4 Directly specify the full name of the template file
$this->display('../Message/test3.html');
//corresponds to Myapp/Tpl/default/Message/test3.html

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1061537.htmlTechArticleThinkphp framework template variables and template output Thinkphp framework template operation variable output: {:function()} //Execution method And output the return value {~function} //The execution method does not output {@var} //Output...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn