You are here

public function AmpAnalytics::getInfo in Accelerated Mobile Pages (AMP) 8

Same name and namespace in other branches
  1. 8.3 src/Element/AmpAnalytics.php \Drupal\amp\Element\AmpAnalytics::getInfo()
  2. 8.2 src/Element/AmpAnalytics.php \Drupal\amp\Element\AmpAnalytics::getInfo()

Returns the element properties for this element.

Return value

array An array of element properties. See \Drupal\Core\Render\ElementInfoManagerInterface::getInfo() for documentation of the standard properties of all elements, and the return value format.

Overrides ElementInterface::getInfo

File

src/Element/AmpAnalytics.php, line 30
Contains \Drupal\amp\Element\AmpAnalytics.

Class

AmpAnalytics
Provides a render element for amp-analytics.

Namespace

Drupal\amp\Element

Code

public function getInfo() {
  $class = get_class($this);
  return array(
    '#account' => NULL,
    '#attributes' => [],
    '#pre_render' => array(
      array(
        $class,
        'preRenderAnalytics',
      ),
    ),
    '#theme' => 'amp_analytics',
    '#cache' => [
      'contexts' => [
        'url.query_args:amp',
      ],
    ],
  );
}