Smarty and Href

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}"&...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-04-2006
J Huntley Palmer
 
Posts: n/a
Default Smarty and Href

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.
Reply With Quote
  #2 (permalink)  
Old 07-04-2006
Rik
 
Posts: n/a
Default Re: Smarty and Href

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


Reply With Quote
  #3 (permalink)  
Old 07-04-2006
Alvaro G. Vicario
 
Posts: n/a
Default Re: Smarty and Href

*** 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
--
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 06:45 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0