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


PHP RequestInterface::getModuleName方法代码示例

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


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

示例1: match

 public function match(RequestInterface $request)
 {
     if ($request->getModuleName() == null && method_exists($request, 'getPathInfo')) {
         $route = $this->application['route.resolver']->process($request->getPathInfo());
         if ($route instanceof Route) {
             switch ($route->getName()) {
                 case Ping::getName():
                     return $this->dispatch($request, 'ping');
                     break;
                 case Registered::getName():
                     return $this->dispatch($request, 'registered');
                     break;
                 case UserData::getName():
                     $data = $route->getData();
                     return $this->dispatch($request, 'user', 'index', $data);
                     break;
                 case CampaignPopup::getName():
                     $data = $route->getData();
                     return $this->dispatch($request, 'migration', 'popup', $data);
                     break;
                 case CampaignMigration::getName():
                     $data = $route->getData();
                     return $this->dispatch($request, 'migration', 'migrate', $data);
                     break;
                 case BatchCustomer::getName():
                     return $this->dispatch($request, 'batch', 'customer');
                     break;
                 case BatchInvoice::getName():
                     return $this->dispatch($request, 'batch', 'invoice');
                     break;
             }
         }
         if (http_response_code() === 401) {
             return $this->dispatch($request, 'unauthorized');
         }
     }
     //        return $this->actionFactory->create(Forward::class, ['request' => $request]);
 }
开发者ID:etwandro,项目名称:magento2,代码行数:38,代码来源:Router.php

示例2: matchModuleFrontName

 /**
  * Match module front name
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @param string $param
  * @return string|null
  */
 protected function matchModuleFrontName(\Magento\Framework\App\RequestInterface $request, $param)
 {
     // get module name
     if ($request->getModuleName()) {
         $moduleFrontName = $request->getModuleName();
     } elseif (!empty($param)) {
         $moduleFrontName = $param;
     } else {
         $moduleFrontName = $this->_defaultPath->getPart('module');
         $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, '');
     }
     if (!$moduleFrontName) {
         return null;
     }
     return $moduleFrontName;
 }
开发者ID:pavelnovitsky,项目名称:magento2,代码行数:23,代码来源:Base.php

示例3: isSessionCheckRequest

 /**
  * Check if a request is session check
  *
  * @return bool
  */
 protected function isSessionCheckRequest()
 {
     return $this->request->getModuleName() == 'security' && $this->request->getActionName() == 'check';
 }
开发者ID:BlackIkeEagle,项目名称:magento2-continuousphp,代码行数:9,代码来源:AuthSession.php

示例4: isTaxConfigPage

 /**
  * Return whether page is tax configuration
  *
  * @return bool
  */
 protected function isTaxConfigPage()
 {
     return $this->request->getModuleName() == 'admin' && $this->request->getControllerName() == 'system_config' && $this->request->getActionName() == 'edit' && $this->request->getParam('section') == 'tax';
 }
开发者ID:classyllama,项目名称:ClassyLlama_AvaTax,代码行数:9,代码来源:ConfigNotification.php

示例5: isQueuePage

 /**
  * Return whether page is queue page
  *
  * @return bool
  */
 protected function isQueuePage()
 {
     return $this->request->getModuleName() == 'avatax' && $this->request->getControllerName() == 'queue' && $this->request->getActionName() == 'index';
 }
开发者ID:classyllama,项目名称:ClassyLlama_AvaTax,代码行数:9,代码来源:QueueDisabledNotification.php

示例6: _getFinancingCondition

 /**
  * Determine if should apply subtotal
  *
  * @param $address
  * @param $shippingAssignment
  *
  * @return bool
  */
 protected function _getFinancingCondition($address, $shippingAssignment)
 {
     $items = $shippingAssignment->getItems();
     return $address->getAddressType() == \Magento\Customer\Helper\Address::TYPE_SHIPPING && count($items) && $this->_request->getModuleName() == 'mercadopago';
 }
开发者ID:SummaSolutions,项目名称:cart-magento2,代码行数:13,代码来源:FinanceCost.php


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