Properties

$layout

$layout : 

Type

$layoutDir

$layoutDir : 

Type

$template

$template : 

Type

$templateDir

$templateDir : 

Type

$compiledDir

$compiledDir : 

Type

$autoCompile

$autoCompile : 

Type

$component

$component : 

Type

$tpl_include_files

$tpl_include_files : 

Type

Methods

__construct()

__construct() 

render()

render() 

template()

template(boolean  $islayout = false) : string

返回编译后的模板路径, 如果不存在则编译生成并返回路径.

如果文件存在且允许自动编译, 则对比模板文件和编译后的文件修改时间 当修改模板后自支重新编译

Parameters

boolean $islayout

是否使用布局

Returns

string —

返回编译后的模板路径

parse()

parse(string  $str) : string

解析{}内字符串,替换php代码

Parameters

string $str

Returns

string

addquote()

addquote(  $var) 

变量加上单引号 如果是数字就不加单引号, 如果已经加上单引号或者双引号保持不变

Parameters

$var

removeComments()

removeComments(  $str,   $clear = false) 

模板中第一行可以写exit函数防止浏览 删除行首尾空白, html javascript css注释

Parameters

$str
$clear

clear()

clear(  $str) 

清除一部分 style script内的注释 多行注释内部存在 / 字符就不会清除

Parameters

$str

parseIncludeComponent()

parseIncludeComponent(  $str) 

Parameters

$str

parseInclude()

parseInclude(  $str) 

解析多个{include path/file}合并成一个文件

Parameters

$str

Examples

'debug_info'} {include 'debug_info.php'} {include "debug_info"} {include "debug_info.php"} {include $this->templateDir . $this->template}
** File not found : {include **

parseComponent()

parseComponent(  $str) 

解析多个{component module action}合并成一个文件

Parameters

$str