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


PHP RequestInterface::getRouteName方法代码示例

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


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

示例1: dispatch

 /**
  * Dispatch request
  *
  * @param RequestInterface $request
  * @return ResponseInterface
  * @throws NotFoundException
  */
 public function dispatch(RequestInterface $request)
 {
     $this->_request = $request;
     $profilerKey = 'CONTROLLER_ACTION:' . $request->getFullActionName();
     $eventParameters = ['controller_action' => $this, 'request' => $request];
     $this->_eventManager->dispatch('controller_action_predispatch', $eventParameters);
     $this->_eventManager->dispatch('controller_action_predispatch_' . $request->getRouteName(), $eventParameters);
     $this->_eventManager->dispatch('controller_action_predispatch_' . $request->getFullActionName(), $eventParameters);
     \Magento\Framework\Profiler::start($profilerKey);
     $result = null;
     if ($request->isDispatched() && !$this->_actionFlag->get('', self::FLAG_NO_DISPATCH)) {
         \Magento\Framework\Profiler::start('action_body');
         $result = $this->execute();
         \Magento\Framework\Profiler::start('postdispatch');
         if (!$this->_actionFlag->get('', self::FLAG_NO_POST_DISPATCH)) {
             $this->_eventManager->dispatch('controller_action_postdispatch_' . $request->getFullActionName(), $eventParameters);
             $this->_eventManager->dispatch('controller_action_postdispatch_' . $request->getRouteName(), $eventParameters);
             $this->_eventManager->dispatch('controller_action_postdispatch', $eventParameters);
         }
         \Magento\Framework\Profiler::stop('postdispatch');
         \Magento\Framework\Profiler::stop('action_body');
     }
     \Magento\Framework\Profiler::stop($profilerKey);
     return $result ?: $this->_response;
 }
开发者ID:shabbirvividads,项目名称:magento2,代码行数:32,代码来源:Action.php

示例2: getConfig

 /**
  * Gather information to be sent to javascript method renderer
  *
  * @return array
  */
 public function getConfig()
 {
     return $this->methodInstance->isAvailable() ? ['payment' => [$this->methodCode => ['bannerUrl' => $this->_scopeConfig->getValue('payment/mercadopago_custom/banner_checkout'), 'country' => strtoupper($this->_scopeConfig->getValue('payment/mercadopago/country', 'default', $this->_storeManager->getStore()->getId())), 'grand_total' => $this->_checkoutSession->getQuote()->getGrandTotal(), 'base_url' => $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK), 'success_url' => $this->methodInstance->getConfigData('order_place_redirect_url'), 'logEnabled' => $this->_scopeConfig->getValue('payment/mercadopago/logs', 'default', $this->_storeManager->getStore()->getId()), 'discount_coupon' => $this->_scopeConfig->isSetFlag('payment/mercadopago_custom/coupon_mercadopago', 'default', $this->_storeManager->getStore()->getId()), 'route' => $this->_request->getRouteName(), 'public_key' => $this->_scopeConfig->getValue('payment/mercadopago_custom/public_key'), 'customer' => $this->methodInstance->getCustomerAndCards(), 'loading_gif' => $this->_assetRepo->getUrl('MercadoPago_Core::images/loading.gif'), 'text-currency' => __('$'), 'text-choice' => __('Choice'), 'default-issuer' => __('Default issuer'), 'text-installment' => __('Enter the card number'), 'logoUrl' => $this->_assetRepo->getUrl("MercadoPago_Core::images/mp_logo.png")]]] : [];
 }
开发者ID:SummaSolutions,项目名称:cart-magento2,代码行数:9,代码来源:CustomConfigProvider.php

示例3: getConfig

 /**
  * @return array
  */
 public function getConfig()
 {
     return $this->methodInstance->isAvailable() ? ['payment' => [$this->methodCode => ['bannerUrl' => $this->methodInstance->getConfigData('banner_checkout'), 'options' => $this->methodInstance->getTicketsOptions(), 'country' => strtoupper($this->_scopeConfig->getValue('payment/mercadopago/country')), 'grand_total' => $this->_checkoutSession->getQuote()->getGrandTotal(), 'success_url' => $this->methodInstance->getConfigData('order_place_redirect_url'), 'route' => $this->_request->getRouteName(), 'base_url' => $this->_storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK), 'discount_coupon' => $this->_scopeConfig->getValue('payment/mercadopago_customticket/coupon_mercadopago'), 'loading_gif' => $this->_assetRepo->getUrl('MercadoPago_Core::images/loading.gif'), 'logEnabled' => $this->_scopeConfig->getValue('payment/mercadopago/logs'), 'logoUrl' => $this->_assetRepo->getUrl("MercadoPago_Core::images/mp_logo.png")]]] : [];
 }
开发者ID:SummaSolutions,项目名称:cart-magento2,代码行数:7,代码来源:CustomTicketConfigProvider.php


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