自定义标签内的定界符<<<str问题

浏览:906 发布日期:2015/03/29 分类:求助交流
<?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
最佳答案
评论() 相关
后面还有条评论,点击查看>>