Page title
@api
- Since
- 100.0.2
Definition at line 17 of file Title.php.
◆ __construct()
__construct |
( |
App\Config\ScopeConfigInterface |
$scopeConfig | ) |
|
- Parameters
-
App\Config\ScopeConfigInterface | $scopeConfig | |
Definition at line 47 of file Title.php.
50 $this->scopeConfig = $scopeConfig;
◆ addConfigValues()
addConfigValues |
( |
|
$title | ) |
|
|
protected |
- Parameters
-
- Returns
- string
Definition at line 113 of file Title.php.
115 $preparedTitle = $this->scopeConfig->getValue(
116 'design/head/title_prefix',
117 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
118 ) .
' ' .
$title .
' ' . $this->scopeConfig->getValue(
119 'design/head/title_suffix',
120 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
122 return trim($preparedTitle);
◆ append()
- Parameters
-
- Returns
- void
Definition at line 143 of file Title.php.
145 $this->appendedValues[] =
$suffix;
◆ build()
build |
( |
|
$withConfigValues = true | ) |
|
|
protected |
- Parameters
-
- Returns
- array
Definition at line 100 of file Title.php.
103 $this->prependedValues,
104 [$withConfigValues ? $this->
addConfigValues($this->textValue) : $this->textValue],
105 $this->appendedValues
◆ get()
Retrieve title element text (encoded)
- Returns
- string
Definition at line 70 of file Title.php.
72 return join(self::TITLE_GLUE, $this->
build());
build($withConfigValues=true)
◆ getDefault()
Retrieve default title text
- Returns
- string
Definition at line 130 of file Title.php.
132 $defaultTitle = $this->scopeConfig->getValue(
133 'design/head/default_title',
134 \
Magento\Store\Model\ScopeInterface::SCOPE_STORE
◆ getShort()
Same as getTitle(), but return only first item from chunk
- Returns
- mixed
Definition at line 80 of file Title.php.
build($withConfigValues=true)
◆ getShortHeading()
Same as getShort(), but return title without prefix and suffix
- Returns
- mixed
Definition at line 90 of file Title.php.
build($withConfigValues=true)
◆ prepend()
- Parameters
-
- Returns
- void
Definition at line 152 of file Title.php.
154 array_unshift($this->prependedValues,
$prefix);
◆ set()
Set page title
- Parameters
-
- Returns
- $this
Definition at line 59 of file Title.php.
◆ unsetValue()
Unset title
- Returns
- void
Definition at line 162 of file Title.php.
164 $this->textValue =
null;
◆ TITLE_GLUE
Default title glue
Definition at line 22 of file Title.php.
The documentation for this class was generated from the following file: