Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields
PathProcessor Class Reference

Public Member Functions

 __construct (\Magento\Store\Model\StoreManagerInterface $storeManager)
 
 process ($pathInfo)
 

Data Fields

const ALL_STORE_CODE = 'all'
 

Detailed Description

Class PathProcessor

Definition at line 14 of file PathProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Store\Model\StoreManagerInterface  $storeManager)
Parameters
\Magento\Store\Model\StoreManagerInterface$storeManager

Definition at line 27 of file PathProcessor.php.

28  {
29  $this->storeManager = $storeManager;
30  }
$storeManager

Member Function Documentation

◆ process()

process (   $pathInfo)

Process path info

Parameters
string$pathInfo
Returns
string
Exceptions
NoSuchEntityException

Definition at line 53 of file PathProcessor.php.

54  {
55  $pathParts = $this->stripPathBeforeStorecode($pathInfo);
56  $storeCode = current($pathParts);
57  $stores = $this->storeManager->getStores(false, true);
58  if (isset($stores[$storeCode])) {
59  $this->storeManager->setCurrentStore($storeCode);
60  $path = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
61  } elseif ($storeCode === self::ALL_STORE_CODE) {
62  $this->storeManager->setCurrentStore(\Magento\Store\Model\Store::ADMIN_CODE);
63  $path = '/' . (isset($pathParts[1]) ? $pathParts[1] : '');
64  } else {
65  $path = '/' . implode('/', $pathParts);
66  }
67  return $path;
68  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17
$storeCode
Definition: indexer.php:15

Field Documentation

◆ ALL_STORE_CODE

const ALL_STORE_CODE = 'all'

Store code alias to indicate that all stores should be affected by action

Definition at line 17 of file PathProcessor.php.


The documentation for this class was generated from the following file: