开发者

Illegal Token error while decoding JSON on Zend Framework

Im running this example given on zendcasts and i seem to be getting a "Illegal Token" error.

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->_getN开发者_如何学GoextToken()
#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',
)  

Help please ....


Turned out to be a case of missing check for the layout.

if ($this->_helper->hasHelper('layout'))
{
     $this->_helper->layout()->disableLayout();
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜