我目前正在Zend 2中开发后端应用程序,我需要禁用整个应用程序的视图。如果我能在初始阶段禁用它,我会非常高兴。这可能吗?
谢谢,
答案 0 :(得分:0)
return $this->getResponse();
答案 1 :(得分:0)
namespace YourModule;
use Zend\Mvc\MvcEvent;
class Module
{
public function onBootstrap(MvcEvent $e)
{
$sharedEvents = $e->getApplication()->getEventManager()->getSharedManager();
$sharedEvents->attach('Zend\Mvc\Controller\AbstractActionController','dispatch',
function($e) {
$response = $e->getResponse();
$response->sendContent();
});
}
}