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
Locale
Deployed
Codes.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Framework\Locale\Deployed
;
7
8
use
Magento\Framework\App\Filesystem\DirectoryList
;
9
use
Magento\Framework\Filesystem
;
10
use
Magento\Framework\Locale\AvailableLocalesInterface
;
11
use
Magento\Framework\View\Design\Theme\FlyweightFactory
;
12
use
Magento\Framework\View\DesignInterface
;
13
17
class
Codes
implements
AvailableLocalesInterface
18
{
24
private
$fileSystem;
25
31
private
$flyweightFactory;
32
38
public
function
__construct
(
39
FlyweightFactory
$flyweightFactory,
40
Filesystem
$fileSystem
41
) {
42
$this->fileSystem = $fileSystem;
43
$this->flyweightFactory = $flyweightFactory;
44
}
45
51
public
function
getList
(
$code
, $area =
DesignInterface::DEFAULT_AREA
)
52
{
53
try
{
54
$theme
= $this->flyweightFactory->create(
$code
, $area);
55
$reader = $this->fileSystem->getDirectoryRead(
DirectoryList::STATIC_VIEW
);
56
$dirs = $reader->read(
$theme
->getFullPath());
57
}
catch
(\Exception $e) {
58
return
[];
59
}
60
61
return
array_map(
'basename'
, $dirs);
62
}
63
}
Magento\Framework\App\Filesystem\DirectoryList\STATIC_VIEW
const STATIC_VIEW
Definition:
DirectoryList.php:53
Magento\Framework\Filesystem
Definition:
Filesystem.php:16
Magento\Framework\Filesystem
Magento\Framework\Locale\Deployed\Codes\getList
getList($code, $area=DesignInterface::DEFAULT_AREA)
Definition:
Codes.php:51
Magento\Framework\Locale\AvailableLocalesInterface
Definition:
AvailableLocalesInterface.php:13
Magento\Framework\View\DesignInterface\DEFAULT_AREA
const DEFAULT_AREA
Definition:
DesignInterface.php:16
Magento\Framework\Locale\Deployed
Definition:
Codes.php:6
Magento\Framework\View\Design\Theme\FlyweightFactory
Definition:
FlyweightFactory.php:11
$theme
$theme
Definition:
theme_rollback.php:9
Magento\Framework\App\Filesystem\DirectoryList
Definition:
DirectoryList.php:13
Magento\Framework\Locale\Deployed\Codes
Definition:
Codes.php:17
Magento\Framework\Locale\Deployed\Codes\__construct
__construct(FlyweightFactory $flyweightFactory, Filesystem $fileSystem)
Definition:
Codes.php:38
Magento\Framework\View\DesignInterface
Definition:
DesignInterface.php:11
$code
$code
Definition:
info.phtml:12