当前位置: 首页>>代码示例>>PHP>>正文


PHP Action::dispatch方法代码示例

本文整理汇总了PHP中Magento\Framework\App\Action\Action::dispatch方法的典型用法代码示例。如果您正苦于以下问题:PHP Action::dispatch方法的具体用法?PHP Action::dispatch怎么用?PHP Action::dispatch使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Magento\Framework\App\Action\Action的用法示例。


在下文中一共展示了Action::dispatch方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: dispatch

 /**
  * {@inheritdoc}
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     if (!$this->_getCheckout()->getCustomer()->getId()) {
         return $this->_redirect('customer/account/login');
     }
     return parent::dispatch($request);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:10,代码来源:Address.php

示例2: dispatch

 /**
  * Dispatch request
  *
  * @param RequestInterface $request
  * @return ResponseInterface
  * @throws NotFoundException
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->customerSession->authenticate()) {
         $this->_actionFlag->set('', 'no-dispatch', true);
     }
     return parent::dispatch($request);
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:14,代码来源:CardsManagement.php

示例3: dispatch

 /**
  * Dispatch request
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  * @throws \Magento\Framework\Exception\NotFoundException
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->scopeConfig->isSetFlag(self::XML_PATH_ENABLED, ScopeInterface::SCOPE_STORE)) {
         throw new NotFoundException(__('Page not found.'));
     }
     return parent::dispatch($request);
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:14,代码来源:Index.php

示例4: dispatch

 /**
  * @param \Magento\Framework\App\RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(\Magento\Framework\App\RequestInterface $request)
 {
     if (!$this->_isAllowed()) {
         throw new NotFoundException(__('Page not found.'));
     }
     return parent::dispatch($request);
 }
开发者ID:fschell,项目名称:magento2-developer-quickdevbar,代码行数:11,代码来源:Index.php

示例5: dispatch

 /**
  * Check customer authentication for some actions
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->customerSession->authenticate()) {
         $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
     }
     return parent::dispatch($request);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:13,代码来源:Customer.php

示例6: dispatch

 /**
  * Dispatch request
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->getRequest()->isDispatched()) {
         parent::dispatch($request);
     }
     $result = parent::dispatch($request);
     return $result;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:14,代码来源:CookieTester.php

示例7: dispatch

 /**
  * Check customer authentication
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     $loginUrl = $this->_objectManager->get('Magento\\Customer\\Model\\Url')->getLoginUrl();
     if (!$this->_customerSession->authenticate($this, $loginUrl)) {
         $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
     }
     return parent::dispatch($request);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:14,代码来源:Products.php

示例8: dispatch

 /**
  * Dispatch request
  *
  * @param RequestInterface $request
  * @return ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     $searchTerms = $this->scopeConfig->getValue('catalog/seo/search_terms', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
     if (!$searchTerms) {
         $this->_redirect('noroute');
         $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
     }
     return parent::dispatch($request);
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:15,代码来源:Popular.php

示例9: dispatch

 /**
  * Check customer authentication
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$request->isDispatched()) {
         return parent::dispatch($request);
     }
     if (!$this->_getSession()->authenticate($this)) {
         $this->_actionFlag->set('', 'no-dispatch', true);
     }
     return parent::dispatch($request);
 }
开发者ID:Coplex,项目名称:magento2,代码行数:16,代码来源:Agreement.php

示例10: dispatch

 /**
  * Dispatch request
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     // Check this module is enabled in frontend
     if ($this->_dataHelper->isEnabledInFrontend()) {
         $result = parent::dispatch($request);
         return $result;
     } else {
         $this->_forward('noroute');
     }
 }
开发者ID:rushvisilk,项目名称:mage2-helloworld,代码行数:16,代码来源:Blog.php

示例11: dispatch

 /**
  * Check customer authentication for some actions
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->customerSession->authenticate()) {
         $this->_actionFlag->set('', 'no-dispatch', true);
         if (!$this->customerSession->getBeforeUrl()) {
             $this->customerSession->setBeforeUrl($this->_redirect->getRefererUrl());
         }
     }
     return parent::dispatch($request);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:16,代码来源:Add.php

示例12: dispatch

 public function dispatch(RequestInterface $request)
 {
     if (!$this->session->isLoggedIn()) {
         return $this->_redirect('customer/account/login');
     }
     if (!$this->config->isEnabled()) {
         return $this->_redirect($this->_redirect->getRefererUrl());
     }
     return parent::dispatch($request);
 }
开发者ID:Viktor-V,项目名称:Facebook-Login,代码行数:10,代码来源:Index.php

示例13: dispatch

 /**
  * Check whether payment method is enabled
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\Controller\Result\Redirect|\Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->braintreePayPalConfig->isActive() || !$this->braintreePayPalConfig->isShortcutCheckoutEnabled()) {
         $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
         /** @var \Magento\Framework\Controller\Result\Redirect $resultRedirect */
         $resultRedirect = $this->resultRedirectFactory->create();
         $resultRedirect->setPath('noRoute');
         return $resultRedirect;
     }
     return parent::dispatch($request);
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:17,代码来源:PayPal.php

示例14: dispatch

 /**
  * Check whether payment method is enabled
  *
  * @inheritdoc
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$this->config->isActive() || !$this->config->isDisplayShoppingCart()) {
         $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true);
         /** @var Redirect $resultRedirect */
         $resultRedirect = $this->resultRedirectFactory->create();
         $resultRedirect->setPath('noRoute');
         return $resultRedirect;
     }
     return parent::dispatch($request);
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:16,代码来源:AbstractAction.php

示例15: dispatch

 /**
  * Make sure customer is logged in and put it into registry
  *
  * @param RequestInterface $request
  * @return \Magento\Framework\App\ResponseInterface
  */
 public function dispatch(RequestInterface $request)
 {
     if (!$request->isDispatched()) {
         return parent::dispatch($request);
     }
     if (!$this->_customerSession->authenticate($this)) {
         $this->_actionFlag->set('', 'no-dispatch', true);
     }
     $customer = $this->_customerSession->getCustomer();
     $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER, $customer);
     $this->_coreRegistry->register(RegistryConstants::CURRENT_CUSTOMER_ID, $customer->getId());
     return parent::dispatch($request);
 }
开发者ID:Atlis,项目名称:docker-magento2,代码行数:19,代码来源:RecurringPayment.php


注:本文中的Magento\Framework\App\Action\Action::dispatch方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。