You are here: Re: [SMARTY] what is the best way to apply a varaible modifier within a text string « Smarty Templates Posts « IT news, forums, messages
Re: [SMARTY] what is the best way to apply a varaible modifier within a text string

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация