Home > Backend Development > PHP Tutorial > thinkphp_template operation_PHP tutorial

thinkphp_template operation_PHP tutorial

WBOY
Release: 2016-07-13 10:29:11
Original
812 people have browsed it

Quick output variables

{:<span>function</span>(&hellip;)} <span>//</span><span>执行方法并输出返回值</span>
{~<span>function</span>} <span>//</span><span>执行方法不输出</span>
{@<span>var</span>} <span>//</span><span>输出Session变量</span>
{<span>#</span><span>var} //输出Cookie变量</span>
{&<span>var</span>} <span>//</span><span>输出配置参数  </span>
{%<span>var</span>} <span>//</span><span>输出语言变量</span>
{.<span>var</span>} <span>//</span><span>输出GET变量</span>
{^<span>var</span>} <span>//</span><span>输出POST变量</span>
{*<span>var</span>} <span>//</span><span>输出常量</span>
Copy after login

Template output

<span>//</span><span>1 直接调用index操作模板</span>
<span>$this</span>-><span>display();
</span><span>//</span><span> 对应Myapp/Tpl/default/Index/index.html
//2 调用Index模块的test1操作模板</span>
<span>$this</span>->display('test1'<span>);
</span><span>//</span><span>对应Myapp/Tpl/default/Index/test1.html
//2 调用Message模块的test2操作模板()</span>
<span>$this</span>->display('Message:test2'<span>);
</span><span>//</span><span>对应Myapp/Tpl/default/Message/test2.html
//3 调用XP主题的Message模块的test2操作模板</span>
<span>$this</span>->display('Xp@Message:test2'<span>);
</span><span>//</span><span>对应Myapp/Tpl/Xp/Message/test2.html
//4 直接指定模板文件的全名</span>
<span>$this</span>->display('../Message/test3.html'<span>);
</span><span>//</span><span>对应Myapp/Tpl/default/Message/test3.html</span>
Copy after login

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/778218.htmlTechArticleQuick output variable {: function ()} // Execute the method and output the return value {~ function } // Execute The method does not output {@ var } // Output Session variable { # var} // Output Cookie variable { var } //...
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template