當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。