[SMARTY] Modifiers on embedded variables
"A.J. Brown" <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <[email protected]> |
Hi All,
Is there any way to use modifiers on embedded variables using backticks?
For example, I need to escape quotes for the "text" parameter of a {popup}
tag. There is static text combined with smarty variables inside the text
parameter,
{popup text="<strong>`$bin.item_name`</strong><br/>`$bin.item_category`"
textsize="2" width="400"}
What I want is something like this:
{popup
text="<strong>`$bin.item_name|escape:"quotes"`</strong><br/>`$bin.item_categ
ory|escape:"quotes"`"}
I've had to resort to the following:
{assign var="popdesc"
value="<strong>`$bin.item_name`</strong><br/>`$bin.item_category`"}
{popup text=$popdesc|escape:"string"}
This works fine for this application. However, I've run across similar
situations where using {assign} was not appropriate, and I've had to resort
to formatting the string in the business logic :(. Is there any way to use
modifiers on `backticked` variables that I'm missing?
Thanks!
A.J. Brown,
BitNotion Intellect
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php