Smarty マニュアル

本日、PHPフレームワークmojavi で、テンプレート Smarty を利用したのでメモ。

○Smarty2.6.7 マニュアル
http://sky.freespace.jp/smarty/SmartyManual_2-6-7J_html/

例:
http://sky.freespace.jp/smarty/SmartyManual_2-6-2J_html/language.modifier.truncate.html

index.php:

$smarty = new Smarty;
$smarty->assign('articleTitle', 'Two Sisters Reunite after Eighteen Years at Checkout Counter.');
$smarty->display('index.tpl');

index.tpl:
{$articleTitle|truncate:30:"...":true}
出力:

Two Sisters Reunite after E...