И столкнулся с ситуацией когда надо вернуть данные через AJAX
Код контроллера
PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?PHP
- class ExtController extends Zend_Controller_Action {
- private $isAjax;
- public function init() {
- $this->isAjax = $this->_request->isXmlHttpRequest();
- if($this->isAjax){
- $this->_helper->disableLayout();
- }
- }
- public function ajaxAction(){
- $this->_helper->ViewRenderer->setNoRender();
- 'status' => 'ok'
- ));
- }
- }