tags:

views:

809

answers:

1

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

+2  A: 
<a href="/{$companyname}/hello" class="mainMenu"/>

(note the shift of opening curly brace).

Michael Krelin - hacker
Thanks! I banged myself against the wall for not seeing this.
Ngu Soon Hui