logo       

Re: [SMARTY] Truncate: msg#00453

php.smarty.general

Subject: Re: [SMARTY] Truncate

Ahh nm it's just another case of RTFM...

{$array[loop].firstname|truncate:1:"":true}

...

Sorry for the wasted space.

Darryl Bleau wrote:

Using:

{section name=loop loop=$array}
{$array[loop].firstname|truncate:1:""} {$array[loop].lastname}
{/section}

To generate only the first character of the name, with the firstname and lastname being 'firstname' and 'lastname', gives back this:

fi lastname

Changing it to |truncate:0:"" gives this:

lastname

How can I just get the first character using truncate? Am I missing something?

Thanks!

Darryl Bleau



--
Darryl Bleau, B.Sc CS, A+
Creative Director
Submersion Corporation
Submersion.com
1-780-608-1616



--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise