RE: str_repeat in Smarty
| From: | David M. Patterson | Date: | Sat, 22 Sep 2001 15:14:26 +0000 |
| Subject: | RE: str_repeat in Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1527@lists.php.net to get a copy of this message | ||
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/