Comments
Copy Code code as follows:
{* This is a single line smarty comments from Jb51.net, the Web page source code cannot see *}
{* This is a multiline
Smarty Notes
Not sent to browser
*}
Template comments are surrounded by asterisks and then surrounded by delimiters, such as: {* This is a comment *}. Smarty annotations are not displayed in the output of the final template, this is different. The former is useful for inserting internal annotations into templates, as no one can see. ;-)
Http://www.itlearner.com/code/smarty_cn/language.basic.syntax.html
Truncate truncate
Copy Code code as follows:
$smarty->assign (' Hxtitle ', ' two sisters reunite after eighteen Years at Checkout Counter. ');
The template is:
Copy Code code as follows:
{$hxtitle}
{$hxtitle |truncate}
{$hxtitle |truncate:30}
{$hxtitle |truncate:30: ""}
{$hxtitle |truncate:30: "---"}
{$hxtitle |truncate:30: "": true}
{$hxtitle |truncate:30: "...": true}
{$hxtitle |truncate:30: '.. ': True:true}
The output is:
Copy Code code as follows:
Two sisters reunite after eighteen Years at Checkout Counter.
Two sisters reunite after eighteen Years at Checkout Counter.
Two sisters reunite ...
Two sisters reunite after
Two sisters reunite after---
Two sisters reunite after Eigh
Two sisters reunite after E ...
Two sisters Re. Ckout Counter.
Can not be intercepted in PHP: http://www.itlearner.com/code/smarty_cn/language.modifier.truncate.html