smarty基本语法

All Smarty template tags are enclosed within delimiters. By default, these delimiters are { and }, but they can be changed.

For these examples, we will assume that you are using the default delimiters. In Smarty, all content outside of delimiters is displayed as static content, or unchanged. When Smarty encounters template tags, it attempts to interpret them, and displays the appropriate output in their place.

Comments[注释]

Template comments are surrounded by asterisks, and that is surrounded by the delimiter tags like so: {* this is a comment *} Smarty comments are not displayed in the final output of the template. They are used for making internal notes in the templates.

翻译:

所有的smarty模板标签都被加上了定界符.默认情况下是 {and},但它们是可被改变的.

例如,我们假定你在使用默认定界符.
在smarty里,所有定界符以外的内容都是静态输出的,或者称之为不可改变.
当smarty遇到了模板标签,将尝试解释他们,然后再以恰当的方式输出 .

模板注释被*号包围,例如 {* this is a comment *}
smarty注释不会在模板文件的最后输出中出现.
它只是模板内在的注释.

例 3-1.注释

{* Smarty *}{* include the header file here *}{include file="header.tpl"}{include file=$includeFile}{include file=#includeFile#}{* display dropdown lists *}<SELECT>{html_options values=$vals selected=$selected output=$output}</SELECT>

转载于:https://www.cnblogs.com/fjnu2010/archive/2010/09/18/1830147.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值