本文整理汇总了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]);
}
示例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;
}
示例3: isSessionCheckRequest
/**
* Check if a request is session check
*
* @return bool
*/
protected function isSessionCheckRequest()
{
return $this->request->getModuleName() == 'security' && $this->request->getActionName() == 'check';
}
示例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';
}
示例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';
}
示例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';
}