parseTagLib方法

浏览:255 发布日期:2010/09/04
- 普通 - 未处理
parseTagLib方法中有语句

foreach ($tLib->tags as $name=>$val)

这个地方的tags属性只在TagLibCx.class.php中定义了. 在parse方法中调用了这个方法, 但是这个方法也用于外置的标签库,比如TagLibHtml.class.php. 但外置的标签库中就没有这个tags属性.

// TagLib库解析
public function parseTagLib($tagLib,&$content,$hide=false)
{
$begin = $this->config['taglib_begin'];
$end = $this->config['taglib_end'];
$tLib = Think::instance('TagLib'.ucwords(strtolower($tagLib)));
foreach ($tLib->tags as $name=>$val){
$tags = array();
if(isset($val['alias'])) {// 别名设置
$tags = explode(',',$val['alias']);
$tags[] = $name;
}else{
$tags[] = $name;
}
$level = isset($val['level'])?$val['level']:1;
$closeTag = isset($val['close'])?$val['close']:true;
foreach ($tags as $tag){
// 实际要解析的标签名称
$parseTag = !$hide?$tagLib.':'.$tag:$tag;
if(empty($val['attr'])){ ......... .........
评论(
后面还有条评论,点击查看>>