0

I use Smarty 3 and I try to extend my links with parameters.

This works fine:

<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>

But when I try to extend this link with an existing $_GET param it causes an syntax error and I got a white page.

<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>

The $_GET param is like cPath=1_3

Is there another way to call a smarty variable inside smarty?

AamirR
  • 11,672
  • 4
  • 59
  • 73
Ronny Linsener
  • 253
  • 3
  • 16

1 Answers1

1

The solution is very trivial. I need to put the param in double quotes and the smarty call in backticks like

<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>
Ronny Linsener
  • 253
  • 3
  • 16