Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
Theme Class Reference

Public Member Functions

 __construct (\Magento\Framework\Config\Dom\UrnResolver $urnResolver, $configContent=null)
 
 getSchemaFile ()
 
 getThemeTitle ()
 
 getMedia ()
 
 getParentTheme ()
 

Data Fields

const THEME_PATH_SEPARATOR = '/'
 

Protected Attributes

 $_data
 
 $urnResolver
 

Detailed Description

@api

Since
100.0.2

Definition at line 16 of file Theme.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Framework\Config\Dom\UrnResolver  $urnResolver,
  $configContent = null 
)

Constructor

Parameters
\Magento\Framework\Config\Dom\UrnResolver$urnResolver
string$configContent

Definition at line 41 of file Theme.php.

44  {
45  $this->urnResolver = $urnResolver;
46  $this->_data = $this->_extractData($configContent);
47  }

Member Function Documentation

◆ getMedia()

getMedia ( )

Get theme media data

Returns
array

Definition at line 108 of file Theme.php.

109  {
110  return $this->_data['media'];
111  }

◆ getParentTheme()

getParentTheme ( )

Retrieve a parent theme code

Returns
array|null

Definition at line 118 of file Theme.php.

119  {
120  $parentTheme = $this->_data['parent'];
121  if (!$parentTheme) {
122  return null;
123  }
124  return explode(self::THEME_PATH_SEPARATOR, $parentTheme);
125  }

◆ getSchemaFile()

getSchemaFile ( )

Get absolute path to theme.xsd

Returns
string

Definition at line 54 of file Theme.php.

55  {
56  return $this->urnResolver->getRealPath('urn:magento:framework:Config/etc/theme.xsd');
57  }

◆ getThemeTitle()

getThemeTitle ( )

Get title for specified theme and package code

Returns
string

Definition at line 98 of file Theme.php.

99  {
100  return $this->_data['title'];
101  }

Field Documentation

◆ $_data

$_data
protected

Definition at line 28 of file Theme.php.

◆ $urnResolver

$urnResolver
protected

Definition at line 33 of file Theme.php.

◆ THEME_PATH_SEPARATOR

const THEME_PATH_SEPARATOR = '/'

Is used for separation path of themes

Definition at line 21 of file Theme.php.


The documentation for this class was generated from the following file: