RE: [SMARTY] modifiers functions
| From: | Nayra Quesada | Date: | Sun, 13 Mar 2005 00:54:03 +0000 |
| Subject: | RE: [SMARTY] modifiers functions | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12318@lists.php.net to get a copy of this message | ||
thanxs Pedro, but I had seen the manual and I still need some help. :-)
Could you give some idea about how to resolve my problem? Thanxsssssss
again!!!! :D
-----Mensaje original-----
De: Pedro Vera [mailto:pedro.vera@gmail.com]
Enviado el: domingo, 13 de marzo de 2005 0:39
Para: Nayra Quesada
Asunto: Re: [SMARTY] modifiers functions
This is straight off the manual:
Example 5-20. truncate
<?php
$smarty = new Smarty;
$smarty->assign('articleTitle', 'Two Sisters Reunite after Eighteen
Years at Checkout Counter.');
$smarty->display('index.tpl');
?>
where index.tpl is:
{$articleTitle}
{$articleTitle|truncate}
{$articleTitle|truncate:30}
{$articleTitle|truncate:30:""}
{$articleTitle|truncate:30:"---"}
{$articleTitle|truncate:30:"":true}
{$articleTitle|truncate:30:"...":true}
This will output:
Two Sisters Reunite after Eighteen Years at Checkout Counter.
Two Sisters Reunite after Eighteen Years at Checkout Counter.
Two Sisters Reunite after...
Two Sisters Reunite after
Two Sisters Reunite after---
Two Sisters Reunite after Eigh
Two Sisters Reunite after E...
--
Pedro Vera
http://veraperez.com
PGP/GPG Public Key: B21A55FA