By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,384 Members | 927 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,384 IT Pros & Developers. It's quick & easy.

Smarty and Href

P: n/a
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.
Jul 4 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Rik
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
Jul 4 '06 #2

P: n/a
*** 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
--
Jul 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.