import('TagLib');
class TagLibHd extends TagLib{
protected $tags=array(
'nav'=>array('attr'=>'limit,order','close'=>1)
);
public function _nav($attr,$content){
$attr=$this->parsexm
$str=<<<str
<?php
\$cate=M('cate')->order("{$attr['order']}")->select();
import('Class.Category',APP_PATH);
\$cate=Category::unlimitedForla
foreach (\$cate as \$v):
?>
str;
$str.=$content;
$str.='<?php endforeach;?>';
return $str;
}
}
?>
为什么中间$str=<<<str.....str;要设置界定符呢?界定符的作用是原生态输出,但是这里也不需要原生态输出啊,麻烦解释一下原理
最佳答案