PHP - Smarty模板引擎 - 翻译 - Manual手册 - Chapter 3. Basic Syntax第3章 基础语法 - Comments注释
Comments
注释
Template comments are surrounded by asterisks, and that is surrounded
by the
delimiter
tags like so:
模板注释被星号包围,然后被分隔标记包围,例如:
Smarty comments are NOT displayed in the final output of the template,
unlike <!-- HTML comments -->.
These are useful for making internal notes in the templates which no one will see ;-)
在最终模板的输出中不显示Smarty注释,与<!-- HTML注释 -->不同,非常适合作为模板的内部注释,而不会被看到。
Example 3-1. Comments within a template
例 3-1. 在模板中的注释
{* I am a Smarty comment, I don't exist in the compiled output *} {* 我是一个Smarty 注释,我在编译输出结果中不存在 *} <html> <head> <title>{$title}</title> </head> <body>
{* another single line smarty comment *} {* 另一个单行的smarty注释 *} <!-- HTML comment that is sent to the browser --> <!-- HTML注释将被发送到浏览器 -->
{* this multiline smarty comment is not sent to browser *} {* 这是多行smarty 注释不会 被发送到浏览器 *} {********************************************************* Multi line comment block with credits block @ author: bg@example.com @ maintainer: support@example.com @ para: var that sets block style @ css: the style output **********************************************************} {********************************************************* 包括贡献区块的多行注释区块 @ author: bg@example.com @ maintainer: support@example.com @ para: 设置区块样式的变量 @ css: 输出样式 **********************************************************}
{* The header file with the main logo and stuff *} {* 头文件包括主标志和材料 *} {include file='header.tpl'}
{* Dev note: the $includeFile var is assigned in foo.php script *} {* 开发注释:$includeFile变量在foo.php脚本中设置 *} <!-- Displays main content block --> <!-- 显示主要内容区块 --> {include file=$includeFile}
{* this <select> block is redundant *} {* 这个 <select> 区块是多余的 *} {* <select name="company"> {html_options options=$vals selected=$selected_id} </select> *}
<!-- Show header from affiliate is disabled --> <!-- 不显示来自于会员的头部 --> {* $affiliate|upper *}
{* you cannot nest comments *} {* 你不能嵌套注释 *} {* <select name="company"> {* <option value="0">-- none -- </option> *} {html_options options=$vals selected=$selected_id} </select> *}
{* cvs tag for a template, below the 36 SHOULD be an american currency . however its converted in cvs.. *} {* 模板中的cvs标记,下面的36应当为美元符号。 在cvs中将被转换 *} {* $Id: Exp $ *} {* $Id: *} </body> </html>
|
|
[Comments注释 - 文档]
http://www.smarty.net/manual/en/language.basic.syntax.php#language.syntax.comments
[PHP - Smarty模板引擎 - 官方网站]
http://smarty.php.net/
[PHP - Smarty模板引擎 - 下载地址]
当前版本
2.6.18,
http://smarty.php.net/do_download.php?download_file=Smarty-2.6.18.tar.gz
全部列表,
http://smarty.php.net/download.php
[PHP - Smarty模板引擎 - 相关论坛]
http://php.board.newsmth.net/
http://forum.csdn.net/SList/PHP/
http://www.phpinsider.com/smarty-forum/
http://news.php.net/php.smarty.general
http://news.php.net/php.smarty.dev
http://news.php.net/php.smarty.cvs
[PHP - Smarty模板引擎 - 关键词]
smarty
[PHP - Smarty模板引擎 - Manual手册]
借助cycle实现循环输出值,
http://smarty.php.net/manual/en/language.function.cycle.php
Smarty的cat函数,
http://smarty.php.net/manual/en/language.modifier.cat.php
Smarty的upper函数,
http://smarty.php.net/manual/en/language.modifier.upper.php
[PHP - Smarty模板引擎 - Manual手册 - Chapter 3. Basic Syntax第3章 基础语法]
翻译, Comments注释, http://smarty.php.net/manual/en/language.basic.syntax.php#language.syntax.comments
Math数学运算,
http://smarty.php.net/manual/en/language.math.php
[PHP - Smarty模板引擎 - Manual手册 - Chapter 5. Variable Modifiers第5章 变量修饰符]
cat将值连接到给定变量之后,
http://smarty.php.net/manual/en/language.modifier.cat.php
upper将字符串转换成大写字母,
http://smarty.php.net/manual/en/language.modifier.upper.php
escape转义修饰符, http://smarty.php.net/manual/en/language.modifier.escape.php
[PHP - Smarty模板引擎 - Manual手册 - Chapter 7. Built-in Functions第7章 内建函数]
{config_load}用于从一个配置文件加载配置变量到模板中, http://www.smarty.net/manual/en/language.builtin.functions.php
{foreach},{foreachelse}用于像访问序数数组一样访问关联数组, http://smarty.php.net/manual/en/language.function.foreach.php
{strip}在显示之前删除每行前后多余的空格和回车字符,
http://smarty.php.net/manual/en/language.function.strip.php
[PHP - Smarty模板引擎 - Manual手册 - Chapter 8. Custom Functions第8章 自定义函数]
{assign}用于在模板执行过程中设置模板变量,
http://smarty.php.net/manual/en/language.custom.functions.php#language.function.assign
{counter}计数器, http://smarty.php.net/manual/en/language.custom.functions.php
[PHP - Smarty模板引擎 - Manual手册 - 第13章 Smarty类方法]
register_function()动态注册模板函数插件,
http://smarty.php.net/manual/en/api.register.function.php
assign_by_ref()按引用赋值,
http://smarty.php.net/manual/en/api.assign.by.ref.php
分享到:
相关推荐
Smarty模板引擎从安装到结合php的使用, 从基础到深入
Smarty是一个使用PHP写出来的模板引擎,是业界最著名的PHP模板引擎之一。Smarty分离了逻辑代码和外在的内容,提供一种易于管理和使用的方法,用来将原本与HTML代码混杂在一起PHP代码逻辑分离。Smarty工作的目的是要...
Smarty 模板引擎教程 chm格式,内容主要有基本语法、变量、组合修改器、内建函数、自定义函数、配置文件、控制台调试、缓存、插件扩展、使用技巧和经验等,比较详细的一个中文手册,如上图示。
PHP Smarty简体中文参考手册(让你更快速掌握PHP Smarty模板引擎,门户型网站常用技术)
php开发典型模块大全-04-Smarty模板
[CMS程序]Smarty模板引擎 v2.6.26_smarty-2.6.26.zip试卷可打印可复制可编辑
php Smarty
PHP Smarty 模板引擎的应用开发
3. Basic Syntax [基本语法] 4. Variables [变量] 5. Variable Modifiers [变量修改器] 6. Combining Modifiers [组合修改器] 7. Built-in Functions [内建函数] 8. Custom Functions [自定义函数] 9. Config ...
官方离线安装包,测试可用。使用rpm -ivh [rpm完整包名] 进行安装
php-smarty教程,php-smarty教程,php-smarty教程,php-smarty教程
3. Basic Syntax [基本语法] Comments [注释] Functions [函数] Attributes [属性] Embedding Vars in Double Quotes [双引号里值的嵌入] Math [数学运算] 4. Variables [变量] ……smarty
┃ 3) 请在使用前查毒 (这也是您使用其它网络资源所必须注意的) 。 ┃ ┃ 4) 由本站提供的程序对您网站或计算机造成严重后果的本站概不负责。┃ ┃ 5) 本站提供的程序均为网上搜集,如果该程序涉及或侵害到您的版权...
Laravel开发-laravel-smarty-view Laravel 4的Smarty模板引擎
3. Basic Syntax [基本语法] Comments [注释] Functions [函数] Attributes [属性] Embedding Vars in Double Quotes [双引号里值的嵌入] Math [数学运算] 4. Variables [变量] Variables assigned from PHP ...
Smarty是一个使用PHP写出来的模板PHP模板引擎,是目前业界最著名的PHP模板引擎之一。它分离了逻辑代码和外在的内容,提供了一种易于管理和使用的方法,用来将原本与HTML代码混杂在一起PHP代码逻辑分离。简单的讲,...
Laravel开发-smarty 改进latrell/smarty,增加配置项,让其支持fis smarty插件的配置项。
smarty是一个使用PHP写出来的模板PHP模板引擎,它提供了逻辑与外在内容的分离,简单的讲,目的就是要使用PHP程序员同美工分 离,使用的程序员改变程序的逻辑内容不会影响到美工的页面设计,美工重新修改页面不会影响...
CSS3手册.chm DHTML 手册.chm javascript.chm jQueryAPI-1.41.chm jsp中文手册.chm php重要知识点,重要函数参考.doc smarty中文手册.chm VBScript 函数手册(普通下载).CHM 经典SQL语句大全.doc 正则表达式系统教程....
php用,smarty模板引擎3.1,无说明文档