首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在Zend Framework上解码JSON时出现非法令牌错误

在Zend Framework上解码JSON时出现非法令牌错误
EN

Stack Overflow用户
提问于 2010-10-19 19:42:15
回答 1查看 1.5K关注 0票数 1

我正在运行这个在zendcasts上给出的例子,我似乎得到了一个“非法令牌”错误。

代码语言:javascript
运行
复制
An error occurred

Application error

Exception information:

Message: Illegal Token

Stack trace:

#0 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Zend/Json/Decoder.php(113): Zend_Json_Decoder->_getNextToken()
#1 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Zend/Json/Decoder.php(154): Zend_Json_Decoder->__construct('call('countrysearch', Array)
#4 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Zend/Controller/Action.php(513): IndexController->indexAction()
#5 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('indexAction')
#6 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#7 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#8 /Applications/Zend/Zend Studio - 7.2.1/plugins/org.zend.php.framework.resource_7.2.0.v20100324-1300/resources/ZendFramework-1/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#9 /Users/kasunt/Sites/zc15/public/index.php(32): Zend_Application->run()
#10 {main}  
Request Parameters:

array (
  'controller' => 'index',
  'action' => 'index',
  'module' => 'default',
)  

请帮帮忙……

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2010-10-19 20:37:18

原来是布局缺少检查的情况。

代码语言:javascript
运行
复制
if ($this->_helper->hasHelper('layout'))
{
     $this->_helper->layout()->disableLayout();
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3967930

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档