本文整理匯總了PHP中Magento\Backend\App\Action::dispatch方法的典型用法代碼示例。如果您正苦於以下問題:PHP Action::dispatch方法的具體用法?PHP Action::dispatch怎麽用?PHP Action::dispatch使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Magento\Backend\App\Action
的用法示例。
在下文中一共展示了Action::dispatch方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dispatch
/**
* Dispatch request
*
* @param \Magento\Framework\App\RequestInterface $request
* @return \Magento\Framework\App\ResponseInterface
*/
public function dispatch(\Magento\Framework\App\RequestInterface $request)
{
$this->_entityTypeId = $this->_objectManager->create('Magento\\Eav\\Model\\Entity')->setType(\Magento\Catalog\Model\Product::ENTITY)->getTypeId();
return parent::dispatch($request);
}
示例2: dispatch
public function dispatch(\Magento\Framework\App\RequestInterface $request)
{
$this->preDispatch($request);
$this->getHelper('Module\\Exception')->setFatalErrorHandler();
try {
$result = parent::dispatch($request);
} catch (\Exception $exception) {
if ($request->getControllerName() == $this->getHelper('Module\\Support')->getPageControllerName()) {
exit($exception->getMessage());
}
if ($this->getHelper('Module')->isDevelopmentEnvironment()) {
throw $exception;
}
$this->getHelper('Module\\Exception')->process($exception);
if ($request->isXmlHttpRequest() || $request->getParam('isAjax')) {
exit($exception->getMessage());
}
$this->getMessageManager()->addError($this->getHelper('Module\\Exception')->getUserMessage($exception));
$params = array('error' => 'true');
if (!is_null($this->getHelper('View')->getCurrentView())) {
$params['referrer'] = $this->getHelper('View')->getCurrentView();
}
return $this->_redirect($this->getHelper('Module\\Support')->getPageRoute(), $params);
}
$this->postDispatch($request);
return $result;
}