public static function AmpAnalytics::preRenderAnalytics in Accelerated Mobile Pages (AMP) 8
Same name and namespace in other branches
- 8.3 src/Element/AmpAnalytics.php \Drupal\amp\Element\AmpAnalytics::preRenderAnalytics()
- 8.2 src/Element/AmpAnalytics.php \Drupal\amp\Element\AmpAnalytics::preRenderAnalytics()
Pre-render callback: Attaches the amp-analytics library.
File
- src/
Element/ AmpAnalytics.php, line 48 - Contains \Drupal\amp\Element\AmpAnalytics.
Class
- AmpAnalytics
- Provides a render element for amp-analytics.
Namespace
Drupal\amp\ElementCode
public static function preRenderAnalytics($element) {
$element['#attached']['library'][] = 'amp/amp.analytics';
return $element;
}