SpeedPHP/模板驱动类:修订间差异
(新页面: {{SpeedPHP top}} ==成员变量== ===public=== *$arrSql -- 执行的SQL语句记录 *$conn -- 数据库链接句柄 ==成员函数== *__construct -- 构造函数,进行数...) |
无编辑摘要 |
||
第1行: | 第1行: | ||
{{SpeedPHP top}} | {{SpeedPHP top}} | ||
==成员变量== | ==成员变量== | ||
public | |||
*$ | *$template_dir —— 模板目录 | ||
*$ | *$enable_gzip —— 是否开启GZIP压缩 | ||
*$compression_level —— GZIP压缩级别 | |||
*$no_compile_dir —— 不检查编译目录 | |||
private | |||
*$_vars —— 模板内使用的变量记录 | |||
==成员函数== | ==成员函数== | ||
* | *assign —— 对模板赋值 | ||
* | *templateExists —— 模板是否存在 | ||
* | *template_exists —— templateExists别名 | ||
* | *registerPlugin —— 注册函数到模板 | ||
* | *display —— 显示模板 | ||
位置:模板驱动类位于 SP_PATH/Drivers/目录中 | |||
==函数详细== | ==函数详细== | ||
* | *assign | ||
void | 对模板赋值 | ||
void assign(string key, mixed value) | |||
参数: | 参数: | ||
*string key 模板中使用变量的名称 | |||
*mixed value 变量值 | |||
*templateExists | |||
检查模板是否存在 | |||
bool templateExists(string template_path) | |||
* | |||
参数: | 参数: | ||
string | string template_path 模板路径 | ||
返回: | 返回: | ||
模板文件存在并能读取返回TRUE。 | |||
模板文件不存在或不能读取返回FALSE。 | |||
*template_exists | |||
* | templateExists的别名。 | ||
* | *registerPlugin | ||
注册函数到模板 | |||
bool registerPlugin(plugin type, string alias, string func_name) | |||
参数: | 参数: | ||
#plugin type 注册类型,默认为“function”。 | |||
#string alias 函数在模板中使用的名称。 | |||
#string func_name 函数执行的回调函数设置。 | |||
返回: | 返回: | ||
注册成功则返回TRUE。不成功返回FALSE。 | |||
* | *display | ||
显示模板 | |||
void display(string template_path) | |||
参数: | 参数: | ||
string template_path 模板路径 | |||
==参考来源== | ==参考来源== | ||
第102行: | 第64行: | ||
{{SpeedPHP}} | {{SpeedPHP}} | ||
[[category:SpeedPHP| | [[category:SpeedPHP|M]] |
2011年5月31日 (二) 16:31的最新版本
SpeedPHP | 快速入门 | 访问交互 | 数据操作 | 框架概述 | 模板引擎 | 优化加速 | 开发指南 | 数据模型 | API参考 |
成员变量[ ]
public
- $template_dir —— 模板目录
- $enable_gzip —— 是否开启GZIP压缩
- $compression_level —— GZIP压缩级别
- $no_compile_dir —— 不检查编译目录
private
- $_vars —— 模板内使用的变量记录
成员函数[ ]
- assign —— 对模板赋值
- templateExists —— 模板是否存在
- template_exists —— templateExists别名
- registerPlugin —— 注册函数到模板
- display —— 显示模板
位置:模板驱动类位于 SP_PATH/Drivers/目录中
函数详细[ ]
- assign
对模板赋值
void assign(string key, mixed value)
参数:
- string key 模板中使用变量的名称
- mixed value 变量值
- templateExists
检查模板是否存在
bool templateExists(string template_path)
参数:
string template_path 模板路径
返回:
模板文件存在并能读取返回TRUE。
模板文件不存在或不能读取返回FALSE。
- template_exists
templateExists的别名。
- registerPlugin
注册函数到模板
bool registerPlugin(plugin type, string alias, string func_name)
参数:
- plugin type 注册类型,默认为“function”。
- string alias 函数在模板中使用的名称。
- string func_name 函数执行的回调函数设置。
返回:
注册成功则返回TRUE。不成功返回FALSE。
- display
显示模板
void display(string template_path)
参数:
string template_path 模板路径
参考来源[ ]
http://speedphp.com/manual.html
SpeedPHP使用手册导航 | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|