class CurrentPageTitle in More Global Variables 8
Class CurrentPageTitle.
@package Drupal\mgv\Plugin\GlobalVariable
@Mgv( id = "current_page_title", );
Hierarchy
- class \Drupal\mgv\Plugin\GlobalVariable implements GlobalVariableInterface uses StringTranslationTrait
- class \Drupal\mgv\Plugin\GlobalVariable\RawCurrentPageTitle
- class \Drupal\mgv\Plugin\GlobalVariable\CurrentPageTitle
- class \Drupal\mgv\Plugin\GlobalVariable\RawCurrentPageTitle
Expanded class hierarchy of CurrentPageTitle
File
- src/
Plugin/ GlobalVariable/ CurrentPageTitle.php, line 14
Namespace
Drupal\mgv\Plugin\GlobalVariableView source
class CurrentPageTitle extends RawCurrentPageTitle {
/**
* {@inheritdoc}
*/
public function getValue() {
$value = parent::getValue();
if (!empty($value)) {
if (is_array($value)) {
$value = urlencode($value['#markup']);
}
elseif (is_object($value)) {
$value = render($value);
}
}
return $value;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CurrentPageTitle:: |
public | function |
Method that implement generating value of global variable. Overrides RawCurrentPageTitle:: |
|
GlobalVariable:: |
private | property | ||
GlobalVariable:: |
private | property | ||
GlobalVariable:: |
public | function | Dependency getter. | |
GlobalVariable:: |
public | function | GlobalVariable constructor. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. |