This is a discussion on Smarty and Href within the PHP Language forums, part of the PHP Programming Forums category; Whenever I put in a smarty variable in a link definition as : <a href="{$foo->bar}"&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Whenever I put in a smarty variable in a link definition as :
<a href="{$foo->bar}">foo</a>, it shows up as a literal as above in the link and not the contents of the variable itself. Everywhere else in the template .. variable substitution works fine. Any help appreciated. |
|
|||
|
J Huntley Palmer wrote:
> Whenever I put in a smarty variable in a link definition as : > > <a href="{$foo->bar}">foo</a>, > > it shows up as a literal as above in the link and not the contents of > the variable itself. Everywhere else in the template .. variable > substitution works fine. Turn on error_reporting(E_ALL). If $foo->bar doesn't exist it will give you an error of E_NOTICE level. If it does exist, I wouldn't know with this little piece what the problem could be. Grtz, -- Rik Wasmus |
|
|||
|
*** J Huntley Palmer escribió/wrote (Mon, 03 Jul 2006 22:40:44 -0400):
> Whenever I put in a smarty variable in a link definition as : > > <a href="{$foo->bar}">foo</a>, > > it shows up as a literal as above in the link and not the contents of > the variable itself. Everywhere else in the template .. variable > substitution works fine. http://smarty.php.net/manual/en/lang...tax.quotes.php "Smarty will recognize assigned variables embedded in double quotes so long as the variables contain only numbers, letters, underscores and brackets []. With any other characters (period, object reference, etc.) the variable must be surrounded by backticks." Hope this helps -- -+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain ++ Mi sitio sobre programación web: http://bits.demogracia.com +- Mi web de humor con rayos UVA: http://www.demogracia.com -- |