简体   繁体   中英

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

I am currently using Smarty-php for the first time, I am struggling however with placing a if statement around the {include} below.

{include './header.tpl'}

Everytime I do the following I get a 500 error.

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

It should be:

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

The is [not] syntax can be used to check if a value is (or is not) even or odd.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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