开发者

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

开发者 https://www.devze.com 2023-03-25 22:00 出处:网络
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

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

精彩评论

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