开发者

Concatenate Smarty Variable with a String in tpl

开发者 https://www.devze.com 2022-12-14 02:50 出处:网络
I have assigned a smarty variable as such in my php file: $smarty->assign(\'companyname\', $_SESSION[\'companyname\']);

I have assigned a smarty variable as such in my php file:

$smarty->assign('companyname', $_SESSION['companyname']);

How to mix regular html string with smarty variable?

I want to do something like:

<a href="/${companyname}/hello" class="mainMenu"/>

But the smarty template engine fails to evaluate properly the v开发者_开发百科ariable companyname


<a href="/{$companyname}/hello" class="mainMenu"/>

(note the shift of opening curly brace).

0

精彩评论

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