|
Posted by Messju Mohr on 05/14/05 13:25
On Sat, May 14, 2005 at 10:28:53AM +0200, lpenou wrote:
> Hello
>
> I'm looking for the best way to apply a modifier to a variable, but
> this variable have to be used in a string, for example
>
> {include file="navigator.tpl" title="This is the Navigator title
> for $item|capitalize"}
>
> capitalize has to be applied only on $item and not the full string
you have to use capture or assign. like
{capture name=title}This is the Navigator title for {$item|capitalize}
{/capture}
{include file="navigator.tpl" title=$smarty.capture.title}
or
{assign var=tmp_item value=$item|capitalize}
{include file="navigator.tpl" title="This is the Navigator title for $tmp_item"}
HTH
messju
> did someone ave a simple solution ?
>
> regards
> Laurent
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
Navigation:
[Reply to this message]
|