Here it is:
Thank you

Module.php
-------------------------------------------------------------------------------
<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link          http://github.com/zendframework/ZendSkeletonApplication for 
the
canonical source repository
 * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc.
(http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Application;

use Zend\Mvc\ModuleRouteListener;
use Zend\Mvc\MvcEvent;
use Zend\EventManager\EventInterface;
//@TODO: $message = $this->getRequest()->query()->get('message', 'foo');
class Module
{
        public function onBootstrap(MvcEvent $e)
        {
                //..
                $em = $e->getApplication()->getEventManager();
        $em->attach(\Zend\Mvc\MvcEvent::EVENT_DISPATCH, array($this,
'onDispatch'));
         }

        public function onDispatch(\Zend\Mvc\MvcEvent $e)
        {
                $app = $e->getParam('application'); 
        $layout = $app->getMvcEvent()->getViewModel(); 
        if( $app->getRequest()->isXmlHttpRequest() ) 
        {
                        $controller = $e->getTarget();
                        $controller->layout('layout/empty');
            $layout->setTerminal(true);
        }
        }
        //..
}
-------------------------------------------------------------------------------

/view/layout/empty.phtml
-------------------------------------------------------------------------------
<?php echo $this->content; ?>
-------------------------------------------------------------------------------



--
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Don-t-display-layout-if-ajax-request-tp4659147p4659154.html
Sent from the Zend Framework mailing list archive at Nabble.com.

-- 
List: fw-general@lists.zend.com
Info: http://framework.zend.com/archives
Unsubscribe: fw-general-unsubscr...@lists.zend.com


Reply via email to