Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
DefaultPath.php
Go to the documentation of this file.
1 <?php
8 namespace Magento\Backend\App;
9 
15 {
19  protected $_parts;
20 
25  public function __construct(\Magento\Backend\App\ConfigInterface $config)
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  }
36 
43  public function getPart($code)
44  {
45  return $this->_parts[$code] ?? null;
46  }
47 }
$config
Definition: fraud_order.php:17
__construct(\Magento\Backend\App\ConfigInterface $config)
Definition: DefaultPath.php:25
$code
Definition: info.phtml:12