Modifiers on embedded variables
| From: | A.J. Brown | Date: | Fri, 04 Nov 2005 17:31:30 +0000 |
| Subject: | Modifiers on embedded variables | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-13149@lists.php.net to get a copy of this message | ||
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