为什么这样呢?XML标签语法错误 : Array

浏览:1959 发布日期:2015/08/05 分类:求助交流
自己扩展了下标签库 关键代码如下
'nav' => array('attr'=> 'limit,order','close'=>1),

public function _nav($attr,$content){
$attr = $this->parsexmlAttr($attr);
return 1111;
}

然后调用
<nav limit="5" order="10">
b
</nav>

只要加了这句 $attr = $this->parsexmlAttr($attr); 就出错如下
不加 可以输出1111

xml标签语法错误 : Array
错误位置
FILE: C:\www\thinkphp\ThinkPHP\Library\Think\Template\TagLib.class.php  LINE: 82
TRACE
#0 C:\www\thinkphp\ThinkPHP\Library\Think\Template\TagLib.class.php(82): E('xml\xE6\xA0\x87\xE7\xAD\xBE\xE8\xAF\xAD\xE6\xB3\x95...')
#1 C:\www\thinkphp\ThinkPHP\Library\Think\Template\TagLib\Qss5ucms.class.php(29): Think\Template\TagLib->parsexmlAttr(Array)
#2 C:\www\thinkphp\ThinkPHP\Library\Think\Template.class.php(450): Think\Template\TagLib\qss5ucms->_nav(Array, 'b')
#3 C:\www\thinkphp\ThinkPHP\Library\Think\Template.class.php(426): Think\Template->parsexmlTag(object(Think\Template\TagLib\qss5ucms), 'nav', 'limit="5" order...', '\r\nb\r\n')
#4 [internal function]: Think\Template->Think\{closure}(Array)
#5 C:\www\thinkphp\ThinkPHP\Library\Think\Template.class.php(427): preg_replace_callback('/]*)>...', object(Closure), '...')
#6 C:\www\thinkphp\ThinkPHP\Library\Think\Template.class.php(181): Think\Template->parseTagLib('qss5ucms', '...', true)
#7 C:\www\thinkphp\ThinkPHP\Library\Think\Template.class.php(126): Think\Template->parse('...')
#8 C:\www\thinkphp\ThinkPHP\Library\Think\Template.class.php(113): Think\Template->compiler('...')
#9 C:\www\thinkphp\ThinkPHP\Library\Think\Template.class.php(76): Think\Template->loadTemplate('./Template/defa...', '')
#10 C:\www\thinkphp\ThinkPHP\Library\Behavior\ParseTemplateBehavior.class.php(32): Think\Template->fetch('./Template/defa...', Array, '')
#11 C:\www\thinkphp\ThinkPHP\Library\Think\Hook.class.php(119): Behavior\ParseTemplateBehavior->run(Array)
#12 C:\www\thinkphp\ThinkPHP\Library\Think\Hook.class.php(89): Think\Hook::exec('Behavior\\ParseT...', 'view_parse', Array)
#13 C:\www\thinkphp\ThinkPHP\Library\Think\View.class.php(126): Think\Hook::listen('view_parse', Array)
#14 C:\www\thinkphp\ThinkPHP\Library\Think\View.class.php(72): Think\View->fetch('', '', '')
#15 C:\www\thinkphp\ThinkPHP\Library\Think\Controller.class.php(56): Think\View->display('', '', '', '', '')
#16 C:\www\thinkphp\Apps\PHP_5UCMS\Controller\IndexController.class.php(17): Think\Controller->display()
#17 [internal function]: PHP_5UCMS\Controller\IndexController->index()
#18 C:\www\thinkphp\ThinkPHP\Library\Think\App.class.php(164): ReflectionMethod->invoke(object(PHP_5UCMS\Controller\IndexController))
#19 C:\www\thinkphp\ThinkPHP\Library\Think\App.class.php(202): Think\App::exec()
#20 C:\www\thinkphp\ThinkPHP\Library\Think\Think.class.php(120): Think\App::run()
#21 C:\www\thinkphp\ThinkPHP\ThinkPHP.php(97): Think\Think::start()
#22 C:\www\thinkphp\index.php(20): require('C:\\www\\thinkphp...')
#23 {main}
最佳答案
评论() 相关
后面还有条评论,点击查看>>