繁体   English   中英

Smarty PHP添加一个{if}语句并包含一个tpl

[英]Smarty PHP add an {if} statement and include a tpl

我目前是第一次使用Smarty-php,但是我在下面的{include}周围放置了if语句,这很麻烦。

{include './header.tpl'}

每次执行以下操作时,都会出现500错误。

{if $smarty.get.special is not "ajax"}
    {include './header.tpl'}
{/if}

它应该是:

{if $smarty.get.special != "ajax"}
    {include file='./header.tpl'}
{/if}

is [not]语法可用于检查值是(还是不是)偶数或奇数。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM