You are here

public function DrupalTitleMetaTag::getElement in Metatag 7

Get the HTML tag for this meta tag.

Return value

array A render array for this meta tag.

Overrides DrupalDefaultMetaTag::getElement

File

./metatag.inc, line 681
Metatag primary classes.

Class

DrupalTitleMetaTag
Title meta tag controller.

Code

public function getElement(array $options = array()) {
  $element = array();
  if ($value = $this
    ->getValue($options)) {
    $element['#attached']['metatag_set_preprocess_variable'][] = array(
      'html',
      'head_title',
      decode_entities($value),
    );
    $element['#attached']['metatag_set_preprocess_variable'][] = array(
      'html',
      'head_array',
      array(
        'title' => $value,
      ),
    );
  }
  return $element;
}