Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
FallbackContext.php
Go to the documentation of this file.
1 <?php
8 
10 
17 class FallbackContext extends Context
18 {
22  private $area;
23 
27  private $theme;
28 
32  private $locale;
33 
40  public function __construct($baseUrl, $areaType, $themePath, $localeCode)
41  {
42  $this->area = $areaType;
43  $this->theme = $themePath;
44  $this->locale = $localeCode;
45  parent::__construct($baseUrl, DirectoryList::STATIC_VIEW, $this->generatePath());
46  }
47 
53  public function getAreaCode()
54  {
55  return $this->area;
56  }
57 
63  public function getThemePath()
64  {
65  return $this->theme;
66  }
67 
73  public function getLocale()
74  {
75  return $this->locale;
76  }
77 
83  private function generatePath()
84  {
85  return $this->area .
86  ($this->theme ? '/' . $this->theme : '') .
87  ($this->locale ? '/' . $this->locale : '');
88  }
89 
95  public function getConfigPath()
96  {
97  return $this->getPath();
98  }
99 }
__construct($baseUrl, $areaType, $themePath, $localeCode)