Definition at line 8 of file MagentoComponent.php.
◆ matchMagentoComponent()
static matchMagentoComponent |
( |
|
$key | ) |
|
|
static |
Get matched Magento component or empty array, if it's not a Magento component
- Parameters
-
- Returns
- string[] ['type' => '<type>', 'area' => '<area>', 'name' => '<name>'] Ex.: ['type' => 'module', 'name' => 'catalog'] ['type' => 'theme', 'area' => 'frontend', 'name' => 'blank']
Definition at line 18 of file MagentoComponent.php.
20 $typePattern =
'module|theme|language|framework';
21 $areaPattern =
'frontend|adminhtml';
22 $namePattern =
'[a-z0-9_-]+';
23 $regex =
'/^magento\/(?P<type>' . $typePattern .
')(?:-(?P<area>' . $areaPattern .
'))?(?:-(?P<name>' 24 . $namePattern .
'))?$/';
25 if (preg_match($regex, $key, $matches)) {
The documentation for this class was generated from the following file: