Smarty - the compiling PHP template engine | ||
---|---|---|
上一篇教材 宏博CMS网站内容管理系统 收集整理 | Chapter 18. Tips & Tricks[使用技巧和经验] | 下一篇教材 |
If a variable is used frequently throughout your templates, applying the default modifier every time it is mentioned can get a bit ugly. You can remedy this by assigning the variable its default value with the assign function.
如果一个变量在你的整个模板里被经常使用,而当你每次要用到这个变量的时候就给它赋默认的值,那将是无法忍受的。你可以通过使用 assign[赋值]这个函数来给这个变量赋上它的默认值来你补救。
上一篇教材 宏博CMS网站内容管理系统 收集整理 | Smarty教材 主目录 | 下一篇教材 |
Tips & Tricks [使用技巧和经验] |
章节索引页 |
Passing variable title to header template [传递变量标题给头模板] |