Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1820359
  • 博文数量: 2245
  • 博客积分: 6004
  • 博客等级: 准将
  • 技术积分: 12955
  • 用 户 组: 普通用户
  • 注册时间: 2007-02-11 06:48
文章分类

全部博文(2245)

文章存档

2011年(10)

2009年(226)

2008年(2009)

我的朋友

分类:

2009-04-25 16:59:44

Chapter6.CombiningModifiers 第6章。组合修改器 Youcanapplyanynumberofmodifierstoavariable.Theywillbeappliedintheordertheyarecombined,fromlefttoright.Theymustbeseparatedwitha|(pipe)character. 对于同一个变量,你可以使用多个修改器。它们将从左到右按照设定好的顺序被依次组合使用。使用时必须要用"|"字符作为它们之间的分隔符。 Example6-1.combiningmodifiers 例6-1.组合修改器 index.php: $smarty=newSmarty; $smarty->assign('articleTitle','SmokersareProductive,butDeathCutsEfficiency.'); $smarty->display('index.tpl'); index.tpl: {$articleTitle} {$articleTitle|upper|spacify} {$articleTitle|lower|spacify|truncate} {$articleTitle|lower|truncate:30|spacify} {$articleTitle|lower|spacify|truncate:30:"..."} OUTPUT: SmokersareProductive,butDeathCutsEfficiency. SMOKERSAREPRODUCTIVE,BUTDEATHCUTSEFFICIENCY. smokersareproductive,butdeathcuts... smokersareproductive,but... smokersarep...
阅读(956) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~