RE: str_repeat in Smarty
| From: | Monte Ohrt | Date: | Sat, 22 Sep 2001 15:30:51 +0000 |
| Subject: | RE: str_repeat in Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1528@lists.php.net to get a copy of this message | ||
FYI if template security is on, you'll have to add 'str_repeat' to the
list of allowed functions, or create a modifier wrapper.
"David M. Patterson" wrote:
>
> You can use many of PHP's functions as modifiers to variables.
> Just remember that the variable is passed to the function as
> the first argument.
>
> To accomplish your repeated space:
>
> $smarty->assign( "nbsp", " " ); // in PHP or
> {assign var="nbsp" value=" "} {* in your
> template *}
> {* then ... *}
> some text{$nbsp|str_repeat:"4"}more text {* in your template. *}
>
> Cheers,
>
> Dave
>
> -----Original Message-----
> From: Michael Jensen [mailto:admin@ogj.dk]
> Sent: Saturday, September 22, 2001 6:28 AM
> To: smarty@lists.ispi.net
> Subject: [smarty] str_repeat in Smarty
>
> Hovdy
>
> I want to get ex.
>
> "    "
>
> from 4 and  .
> In php there is a function called str_repeat(4," ")
>
> How do I get that result with Smarty?
>
> ---
> You are currently subscribed to smarty as: phpdev@dplhenterprises.com
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
>
> ---
> You are currently subscribed to smarty as: monte@ispi.net
> To unsubscribe send a blank email to $subst('Email.Unsub')
> Visit Smarty's homepage at
> http://www.phpinsider.com/php/code/Smarty/
--
Monte Ohrt <monte@ispi.net>
http://www.ispi.net/