开发者

how to add php code in .tpl type of file in cs-cart

can anyone tell me how to add php code in .tpl file e.g i want to add the following code but it didn't work

{php}
    if(isset($_GET['redirect']) && $_GET['redirect']=='clipboard'){

    echo '<input type="hidden" name="check" val开发者_StackOverflow社区ue="redirect" />' ;

 } 
 else{

     echo '<input type="hidden" name="check" value="notredirect" />' ;
 }

{/php}


I think that what you want is this:

<input type="hidden" name="check" value="{if $smarty.get.redirect != "clipboard"}not{/if}redirect" />


You must set:

'allow_php_in_templates' => true, // Allow to use {php} tags in templates

in your config.local.php, and then it will work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜