/** * Dispatches controller_action_postdispatch_adminhtml Event * * @param RequestInterface $request * @return \Magento\Framework\App\ResponseInterface */ public function dispatch(RequestInterface $request) { $response = parent::dispatch($request); if (!$this->_actionFlag->get('', self::FLAG_NO_POST_DISPATCH)) { $this->_eventManager->dispatch('controller_action_postdispatch_adminhtml', ['controller_action' => $this]); } return $response; }
/** * 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); }
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; }