Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
framework
App
Config
ConfigPathResolver.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\App\Config
;
7
8
use
Magento\Store\Model\ScopeInterface
;
9
13
class
ConfigPathResolver
14
{
18
private
$scopeCodeResolver;
19
23
public
function
__construct
(
ScopeCodeResolver
$scopeCodeResolver)
24
{
25
$this->scopeCodeResolver = $scopeCodeResolver;
26
}
27
44
public
function
resolve
(
$path
, $scope =
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
, $scopeCode =
null
,
$type
=
null
)
45
{
46
$path
= trim(
$path
,
'/'
);
47
$scope = rtrim($scope,
's'
);
48
50
if
(in_array($scope, [ScopeInterface::SCOPE_STORE, ScopeInterface::SCOPE_WEBSITE])) {
51
$scope .=
's'
;
52
}
53
54
$scopePath =
$type
?
$type
.
'/'
. $scope : $scope;
55
56
if
($scope !==
ScopeConfigInterface::SCOPE_TYPE_DEFAULT
) {
57
if
(is_numeric($scopeCode) || $scopeCode ===
null
) {
58
$scopeCode = $this->scopeCodeResolver->resolve($scope, $scopeCode);
59
}
60
61
$scopePath .=
'/'
. $scopeCode;
62
}
63
64
return
$scopePath . (
$path
?
'/'
.
$path
:
''
);
65
}
66
}
Magento\Framework\App\Config
Definition:
Base.php:9
Magento\Framework\App\Config\ConfigPathResolver\__construct
__construct(ScopeCodeResolver $scopeCodeResolver)
Definition:
ConfigPathResolver.php:23
Magento\Framework\App\Config\ScopeCodeResolver
Definition:
ScopeCodeResolver.php:13
Magento\Framework\App\Config\ScopeConfigInterface\SCOPE_TYPE_DEFAULT
const SCOPE_TYPE_DEFAULT
Definition:
ScopeConfigInterface.php:20
$type
$type
Definition:
item.phtml:13
Magento\Store\Model\ScopeInterface
Definition:
ScopeInterface.php:12
Magento\Framework\App\Config\ConfigPathResolver
Definition:
ConfigPathResolver.php:13
Magento\Framework\App\Config\ConfigPathResolver\resolve
resolve($path, $scope=ScopeConfigInterface::SCOPE_TYPE_DEFAULT, $scopeCode=null, $type=null)
Definition:
ConfigPathResolver.php:44
$path
$path
Definition:
import_with_filesystem_images.php:14