Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/288.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 如何在smarty模板中调用smarty变量_Php_Smarty_Http Parameters - Fatal编程技术网

Php 如何在smarty模板中调用smarty变量

Php 如何在smarty模板中调用smarty变量,php,smarty,http-parameters,Php,Smarty,Http Parameters,我使用Smarty 3,并尝试使用参数扩展链接 这很好: <a href="{$smarty.const.FILENAME_DEFAULT|xtc_href_link:'filter_license=1'}" class="btn btn-default btn-lg {if $smarty.get.filter_license == '1'}active{/if}">some text</a> $\u GET参数类似于cPath=1\u 3 有没有其他方法可以在sma

我使用Smarty 3,并尝试使用参数扩展链接

这很好:

<a href="{$smarty.const.FILENAME_DEFAULT|xtc_href_link:'filter_license=1'}" class="btn btn-default btn-lg {if $smarty.get.filter_license == '1'}active{/if}">some text</a>
$\u GET
参数类似于cPath=1\u 3


有没有其他方法可以在smarty内部调用smarty变量?

解决方案非常简单。我需要把param放在双引号里,把smarty调用放在backticks里,比如

<a href="{$smarty.const.FILENAME_DEFAULT|xtc_href_link:"cPath=`$smarty.get.cPath`&filter_license=1"}" class="btn btn-default btn-lg {if $smarty.get.filter_license == '1'}active{/if}">some text</a>

<a href="{$smarty.const.FILENAME_DEFAULT|xtc_href_link:"cPath=`$smarty.get.cPath`&filter_license=1"}" class="btn btn-default btn-lg {if $smarty.get.filter_license == '1'}active{/if}">some text</a>