-
Notifications
You must be signed in to change notification settings - Fork 9.4k
/
Copy pathDesignLoader.php
58 lines (53 loc) · 1.32 KB
/
DesignLoader.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Framework\View;
class DesignLoader
{
/**
* Request
*
* @var \Magento\Framework\App\RequestInterface
*/
protected $_request;
/**
* Application
*
* @var \Magento\Framework\App\AreaList
*/
protected $_areaList;
/**
* Layout
*
* @var \Magento\Framework\App\State
*/
protected $appState;
/**
* @param \Magento\Framework\App\RequestInterface $request
* @param \Magento\Framework\App\AreaList $areaList
* @param \Magento\Framework\App\State $appState
*/
public function __construct(
\Magento\Framework\App\RequestInterface $request,
\Magento\Framework\App\AreaList $areaList,
\Magento\Framework\App\State $appState
) {
$this->_request = $request;
$this->_areaList = $areaList;
$this->appState = $appState;
}
/**
* Load design
*
* @return void
*/
public function load()
{
$area = $this->_areaList->getArea($this->appState->getAreaCode());
$area->load(\Magento\Framework\App\Area::PART_DESIGN);
$area->load(\Magento\Framework\App\Area::PART_TRANSLATE);
$area->detectDesign($this->_request);
}
}