<?php
/**
* 自定义标签库
*/
class TagLibMyTag extends TagLib {
protected $tags = array(
'nav' => array(
'attr' => 'order',
'close' => 1
),
);
public function _nav ($attr,$content)
{
$str = <<<str
<?php
import('Class.Category',APP_PATH);
\$cate = M('cate')->order('sort')->select();
\$cate = Category::unlimitedForLayer(\$cate);
?>
str;
$str .= $content;
return $str;
}
}
?>报错syntax error, unexpected $end错误位置
FILE: D:\wamp\www\blog\APP\Modules\Index\TagLib\TagLibMyTag.class.php LINE: 29
最佳答案