Re: Modifiers on embedded variables

From: Date: Mon, 07 Nov 2005 17:47:46 +0000
Subject: Re: Modifiers on embedded variables
References: 1 2  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-13153@lists.php.net to get a copy of this message
I would use {capture} eg {capture assign=foo} <strong>{$bin.item_name|escape:'quotes'}</strong><br/>{$bin.item_category|escape:'quotes'} {/capture} then later in the template {popup text=$foo} have fun Pete A.J. Brown wrote:
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


« previous php.smarty.general (#13153) next »