本文整理汇总了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;
}