Si, prova a creare un controller con questi metodi:
public function preDispatch(){
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
public function init(){}
Al posto del tuo "pagina.php" chiama tuosito/controller/action ( sostituisci controller e action con i reali nomi dei tuoi controller e action ).
Potresti anche creare un controller di base, ovvero estendere Zend_Controller_Action ( es. My_Controller_Action extends Zend_Controller_Action ) e creare i tuoi controller estendendo questa classe ( es. AuthController extends My_Controller_Action ), ed inserire i metodi sopracitati al suo interno che si attivino solo ad una certa richiesta ( per esempio se nella richiesta c'è una certa variabile con un certo valore )
Così ad esempio
Codice PHP:
public function preDispatch(){
$this->_cRequest = $this->getRequest();
$this->_cParams = $this->_cRequest->getParams();
$this->_cAsync = isset($this->_cParams['async']) && $this->_cParams['async'] == 'true' ? true : false;
if($this->_cAsync){
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);
}
}
public function init(){
$this->_cRequest = $this->getRequest();
$this->_cParams = $this->_cRequest->getParams();
$this->_cAsync = isset($this->_cParams['async']) && $this->_cParams['async'] == 'true' ? true : false;
// Se la richiesta è asincrona usciamo da init, tutto quello che c'è dopo sarebbe nocivo alla risposta
if(true === $this->_cAsync){
return true;
}
// qui altro codice che serve nell'init per le richieste non asincrone
}
Prova e fammi sapere.
Ciao