PHP Class think\template\TagLib

Author: liu21st ([email protected])
ファイルを表示 Open project: top-think/framework Class Usage Examples

Protected Properties

Property Type Description
$comparison
$parse array 标签库分析数组
$tagLib string 标签库名称
$tagList array 标签库标签列表
$tags
$tpl object 当前模板对象
$valid boolean 标签库是否有效
$xml string 标签库定义XML文件

Public Methods

Method Description
__construct ( stdClass $template ) 架构函数
autoBuildVar ( string &$name ) : string 自动识别构建变量
getTags ( ) 获取标签定义
parseAttr ( string $str, string $name, string $alias = '' ) : array 分析标签属性 正则方式
parseCondition ( string $condition ) : string 解析条件表达式
parseTag ( string &$content, string $lib = '' ) : void 按签标库替换页面中的标签

Private Methods

Method Description
getRegex ( array | string $tags, boolean $close ) : string 按标签生成正则

Method Details

__construct() public method

架构函数
public __construct ( stdClass $template )
$template stdClass 模板引擎对象

autoBuildVar() public method

自动识别构建变量
public autoBuildVar ( string &$name ) : string
$name string 变量描述
return string

getTags() public method

获取标签定义
public getTags ( )

parseAttr() public method

分析标签属性 正则方式
public parseAttr ( string $str, string $name, string $alias = '' ) : array
$str string 标签属性字符串
$name string 标签名
$alias string 别名
return array

parseCondition() public method

解析条件表达式
public parseCondition ( string $condition ) : string
$condition string 表达式标签内容
return string

parseTag() public method

按签标库替换页面中的标签
public parseTag ( string &$content, string $lib = '' ) : void
$content string 模板内容
$lib string 标签库名
return void

Property Details

$comparison protected_oe property

protected $comparison

$parse protected_oe property

标签库分析数组
protected array $parse
return array

$tagLib protected_oe property

标签库名称
protected string $tagLib
return string

$tagList protected_oe property

标签库标签列表
protected array $tagList
return array

$tags protected_oe property

protected $tags

$tpl protected_oe property

当前模板对象
protected object $tpl
return object

$valid protected_oe property

标签库是否有效
protected bool $valid
return boolean

$xml protected_oe property

标签库定义XML文件
protected string $xml
return string