smarty template engine
Friday, July 25, 2008  
download | documentation | faq | forum | mailing lists | changelog | contribs 


search for in the  


strip

Ini mengganti semua spasi yang berulang, baris baru dan tab dengan spasi tunggal, atau dengan string yang disertakan.

Catatan: Jika anda ingin memotong blok teks template, gunakan fungsi built-in {strip}.

Teladan 5-19. strip

<?php
$smarty
->assign('articleTitle'"Grandmother of\neight makes\t    hole in one.");
$smarty->display('index.tpl');
?>

Di mana template adalah:

{$articleTitle}
{$articleTitle|strip}
{$articleTitle|strip:'&nbsp;'}

Akan memperlihatkan:

Grandmother of
eight makes        hole in one.
Grandmother of eight makes hole in one.
Grandmother&nbsp;of&nbsp;eight&nbsp;makes&nbsp;hole&nbsp;in&nbsp;one.

Lihat juga {strip} dan truncate.




 

credits 

Smarty Copyright © 2002-2008
New Digital Group, Inc.

All rights reserved.