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


PHP RequestInterface::getOriginalPathInfo方法代码示例

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


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

示例1: aroundDispatch

 /**
  * Call method around dispatch frontend action
  *
  * @param FrontControllerInterface $subject
  * @param \Closure                 $proceed
  * @param RequestInterface         $request
  * @return $this
  * @SuppressWarnings(PHPMD.UnusedFormalParameter)
  * @SuppressWarnings(PHPMD)
  */
 public function aroundDispatch(FrontControllerInterface $subject, \Closure $proceed, RequestInterface $request)
 {
     $startTime = microtime(true);
     if (isset($_SERVER['REQUEST_TIME_FLOAT'])) {
         $startTime = $_SERVER['REQUEST_TIME_FLOAT'];
     }
     /** @var \Magento\Framework\App\Request\Http $request */
     if (strpos($request->getOriginalPathInfo(), 'searchautocomplete/ajax/suggest') !== false) {
         $this->result->init();
         $proceed($request);
         #require for init translations
         $request->setControllerModule('Magento_CatalogSearch');
         $request->setDispatched(true);
         $identifier = 'QUERY_' . $this->storeManager->getStore()->getId() . '_' . md5($request->getParam('q'));
         if ($result = $this->cache->load($identifier)) {
             $result = \Zend_Json::decode($result);
             $result['time'] = round(microtime(true) - $startTime, 4);
             $result['cache'] = true;
             $data = \Zend_Json::encode($result);
         } else {
             // mirasvit core event
             $this->eventManager->dispatch('core_register_urlrewrite');
             $result = $this->result->toArray();
             $result['success'] = true;
             $result['time'] = round(microtime(true) - $startTime, 4);
             $result['cache'] = false;
             $data = \Zend_Json::encode($result);
             $this->cache->save($data, $identifier, [\Magento\PageCache\Model\Cache\Type::CACHE_TAG]);
         }
         $this->response->setPublicHeaders(3600);
         return $this->response->representJson($data);
     } else {
         return $proceed($request);
     }
 }
开发者ID:Doability,项目名称:magento2dev,代码行数:45,代码来源:Plugin.php

示例2: matchActionPath

 /**
  * Match controller name
  *
  * @param \Magento\Framework\App\RequestInterface $request
  * @param string $param
  * @return string
  */
 protected function matchActionPath(\Magento\Framework\App\RequestInterface $request, $param)
 {
     if ($request->getControllerName()) {
         $actionPath = $request->getControllerName();
     } elseif (!empty($param)) {
         $actionPath = $param;
     } else {
         $actionPath = $this->_defaultPath->getPart('controller');
         $request->setAlias(\Magento\Framework\Url::REWRITE_REQUEST_PATH_ALIAS, ltrim($request->getOriginalPathInfo(), '/'));
     }
     return $actionPath;
 }
开发者ID:pavelnovitsky,项目名称:magento2,代码行数:19,代码来源:Base.php

示例3: isVdeRequest

 /**
  * This method returns an indicator of whether or not the current request is for vde
  *
  * @param RequestInterface $request
  * @return bool
  */
 public function isVdeRequest(RequestInterface $request = null)
 {
     $result = false;
     if (null !== $request) {
         $splitPath = explode('/', trim($request->getOriginalPathInfo(), '/'));
         if (count($splitPath) >= 3) {
             list($frontName, $currentMode, $themeId) = $splitPath;
             $result = $frontName === $this->_frontName && in_array($currentMode, [\Magento\DesignEditor\Model\State::MODE_NAVIGATION]) && is_numeric($themeId);
         }
     }
     return $result;
 }
开发者ID:aiesh,项目名称:magento2,代码行数:18,代码来源:Data.php


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