You are here

class CurrentPageTitle in More Global Variables 8

Class CurrentPageTitle.

@package Drupal\mgv\Plugin\GlobalVariable

@Mgv( id = "current_page_title", );

Hierarchy

Expanded class hierarchy of CurrentPageTitle

File

src/Plugin/GlobalVariable/CurrentPageTitle.php, line 14

Namespace

Drupal\mgv\Plugin\GlobalVariable
View 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

Namesort descending Modifiers Type Description Overrides
CurrentPageTitle::getValue public function Method that implement generating value of global variable. Overrides RawCurrentPageTitle::getValue
GlobalVariable::$configurations private property
GlobalVariable::$dependency private property
GlobalVariable::getDependency public function Dependency getter.
GlobalVariable::__construct public function GlobalVariable constructor.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.