Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
DefaultPath Class Reference
Inheritance diagram for DefaultPath:
DefaultPathInterface

Public Member Functions

 __construct (\Magento\Backend\App\ConfigInterface $config)
 
 getPart ($code)
 

Protected Attributes

 $_parts
 

Detailed Description

@api

Since
100.0.2

Definition at line 14 of file DefaultPath.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Backend\App\ConfigInterface  $config)
Parameters
\Magento\Backend\App\ConfigInterface$config@SuppressWarnings(PHPMD.NPathComplexity)

Definition at line 25 of file DefaultPath.php.

26  {
27  $pathParts = explode('/', $config->getValue('web/default/admin'));
28 
29  $this->_parts = [
30  'area' => isset($pathParts[0]) ? $pathParts[0] : '',
31  'module' => isset($pathParts[1]) ? $pathParts[1] : 'admin',
32  'controller' => isset($pathParts[2]) ? $pathParts[2] : 'index',
33  'action' => isset($pathParts[3]) ? $pathParts[3] : 'index',
34  ];
35  }
$config
Definition: fraud_order.php:17

Member Function Documentation

◆ getPart()

getPart (   $code)

Retrieve default path part by code

Parameters
string$code
Returns
string

Implements DefaultPathInterface.

Definition at line 43 of file DefaultPath.php.

44  {
45  return $this->_parts[$code] ?? null;
46  }
$code
Definition: info.phtml:12

Field Documentation

◆ $_parts

$_parts
protected

Definition at line 19 of file DefaultPath.php.


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