Ver Mensaje Individual
  #2 (permalink)  
Antiguo 24/07/2008, 17:14
zsamer
 
Fecha de Ingreso: noviembre-2003
Mensajes: 798
Antigüedad: 20 años, 5 meses
Puntos: 8
Respuesta: ZendFramework: evitar template en la accion

En el manual sale todo.

En la acción:
Código PHP:
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender(true); 
Forma más extremista:
Código PHP:
<?php
class FooController extends Zend_Controller_Action
{
    public function 
init()
    {
        
$this->_helper->layout->disableLayout();

        
// Local to this controller only; affects all actions, as loaded in init:
        
$this->_helper->viewRenderer->setNoRender(true);

        
// Globally:
        
$this->_helper->removeHelper('viewRenderer');

        
// Also globally, but would need to be in conjunction with the local
        // version in order to propagate for this controller:
        
Zend_Controller_Front::getInstance()->setParam('noViewRenderer'true);
    }
}
Si vas a trabajar con AJAX deberías usar ContextSwitch and AjaxContext Action Helpers.
Saludos,

Última edición por zsamer; 24/07/2008 a las 17:23