473,396 Members | 1,814 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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.
Jul 4 '06 #1
2 4090
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
*** 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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mark | last post by:
Does Smarty support assigning multidimensional arrays? I've tried to get it working, but just can't get it. can someone help me? this is what I have in my php file: $side_bar = array('link'...
2
by: Daan | last post by:
Hello all, I'm having a little problem with Smarty. Getting it to work in a simple case went fine, but now I have the following situation: / /smarty /templates template.tpl /templates_c
1
by: Richard | last post by:
I need help. I have a smarty based program that I am modifying. I have a smarty template file that consists of smarty and HTML. I need to integrate some PHP database calls into it. My problem...
2
by: M | last post by:
Hi Folks, I am trying to install Smarty using PHP 5 on a Windows XP PC using IIS v6 The following PHP File: <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head>
0
by: Matt | last post by:
geez, i've done this a million times, you'd think i could get it right. uploading to production server for a new site, and part of the head.inc that starts everything up looks like this: echo...
2
by: recordlovelife | last post by:
So I am trying to display a title, date, and content of a wordpress blog. Word press provides nice drop in functions to get the job done with simple names like "the_title", and the "the_content" But...
1
by: empiresolutions | last post by:
i have what may be a very simple question for someone who has worked with X-Cart or Smarty. I am adding a rollover image next to the category names in the main navigation. The following is my...
1
by: ajaymohank | last post by:
hello friends.......... i am new to smarty. can anyone please tell me how to get the value from a dynamically generated checkbox using smarty. this is the code i used... here i am generating 10...
3
dlite922
by: dlite922 | last post by:
Hey guys, For the love of all things holy I can't figure out how to add two numbers together in smarty. I've checked the manual, there's no main section, if it's in there, it's probably lost...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.