Smarty 基本语法(三)
Smarty 2.6.11 文档第二部分,模板设计者(Template Designers)
|-第三章,基本语法(Basic Syntax)
|-第三部分,翻译于2006年8月6日。
Math | 数字 | |
Math can be applied directly to variable values. | 数字可以直接应用于变量中。 | |
|
||
See also the {math} function for complex equations. | 注意复杂等式中的函数{math}。 | |
Escaping Smarty Parsing | 避开Smarty解析 | |
It is sometimes desirable or even necessary to have Smarty ignore sections it would otherwise parse. A classic example is embedding Javascript or CSS code in a template. The problem arises as those languages use the { and } characters which are also the default delimiters for Smarty. | 有时候让Smarty忽略其他的对块的解析是需要的乃至必须的。一个经典的例子是在模板Javascript或者CSS代码中。问题在于这些语言使用{和}字符,而它们也是Smarty默认的定界符。 | |
The simplest thing is to avoid the situation altogether by separating your Javascript and CSS code into their own files and then using standard HTML methods to access them. | 完全避免这种情况最简单的方法,是通过分割你的Javascript和CSS代码到它们自己的文件中,使用标准的HTML方法访问它们。 | |
Including literal content is possible using {literal} .. {/literal} blocks. Similar to HTML entity usage, you can use {ldelim},{rdelim} or {$smarty.ldelim} to display the current delimiters. | 使用{literal} .. {/literal}块包含文字内容是可以的,像HTML实体使用,你可以使用{ldelim}、{rdelim}或者{$smarty.ldelim}来显示当前的定界符。 | |
It is often convenient to simply change Smarty’s $left_delimiter and $right_delimiter. | 简单地改变Smarty的$left_delimiter和$right_delimiter是非常方便的。 | |
|
||
Where example.tpl is: | example.tpl代码: | |
|
||
See also escape modifier. | 注意修改的地方。 |
第三章翻译完成。
原创文章,转载请注明: 转载自www.webmaster.me
本文链接地址: Smarty 基本语法(三)
本站遵循CC协议署名-非商业性使用-相同方式共享
转载请注明来自:站长笔记
相关推荐
- JPGBOX – 速度很快的外链图片空间
- Posted on 04月04日
- Microsoft(R) Firefox 2007 Professional
- Posted on 11月14日
- FreeBSD 6.2 中配置 防火墙 IPFILTER
- Posted on 08月25日
- 帮新手从6款基金中选2款基金定投
- Posted on 12月11日