本文整理汇总了PHP中Enlight_Event_EventArgs::getResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP Enlight_Event_EventArgs::getResponse方法的具体用法?PHP Enlight_Event_EventArgs::getResponse怎么用?PHP Enlight_Event_EventArgs::getResponse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enlight_Event_EventArgs
的用法示例。
在下文中一共展示了Enlight_Event_EventArgs::getResponse方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onDispatchEvent
/**
* Listener method for the Enlight_Controller_Front_PostDispatch event.
*
* @param Enlight_Event_EventArgs $args
* @return void
*/
public function onDispatchEvent(Enlight_Event_EventArgs $args)
{
if (!$args->getResponse()->isException()) {
return;
}
$exception = $args->getResponse()->getException();
$this->handleException($exception[0]);
}
示例2: onDispatchLoopShutdown
/**
* Listener method of the Enlight_Controller_Front_DispatchLoopShutdown event.
* On Dispatch Shutdown collects results and dumps to log component.
*
* @param \Enlight_Event_EventArgs $args
*/
public function onDispatchLoopShutdown(\Enlight_Event_EventArgs $args)
{
/** @var \Enlight_Controller_Request_Request $request */
$request = $args->getSubject()->Request();
/** @var Clockwork $clockwork */
$clockwork = $this->container->get('shopwareclockwork.clockwork');
/** @var \Enlight_Controller_Response_ResponseHttp $response */
$response = $args->getResponse();
$response->setHeader("X-Clockwork-Id", $clockwork->getRequest()->id);
$response->setHeader("X-Clockwork-Version", $clockwork::VERSION);
$response->setHeader("X-Clockwork-Path", '/Clockwork/index/id/');
$shopwareDataSource = $this->container->get('shopwareclockwork.datasource');
$shopwareDataSource->setBaseInfo($request);
$clockwork->addDataSource(new PhpDataSource());
$clockwork->addDataSource($shopwareDataSource);
$clockwork->resolveRequest();
$clockwork->storeRequest();
}