zend框架每个action会自动跳转到对应的view和layouts中,要想使用ajax就必须先要禁用掉跳转。
前端ajax照样写,后端的写法
$this->_helper->layout()->disableLayout(); //禁用布局的跳转
$this->_helper->viewRenderer->setNoRender(true); //禁用路由的跳转
数据返回
$return = array(
'result'=>-1,
'msg'=>'非法数据'
);
echo json_encode($result);
[专注待办](https://itunes.apple.com/cn/app/zhuan-zhu-dai-ban-ding-shi/id1103227570?mt=8)