You are here

public function CurrentPageTitle::getValue in More Global Variables 8

Method that implement generating value of global variable.

Return value

mixed Return value of declared variable.

Overrides RawCurrentPageTitle::getValue

File

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

Class

CurrentPageTitle
Class CurrentPageTitle.

Namespace

Drupal\mgv\Plugin\GlobalVariable

Code

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;
}