You are here

public function AmpSocialPost::getInfo in Accelerated Mobile Pages (AMP) 8.3

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/AmpSocialPost.php, line 36

Class

AmpSocialPost
Provides AMP social post elements.

Namespace

Drupal\amp\Element

Code

public function getInfo() {
  $class = get_class($this);
  return array(
    '#theme' => 'amp_social_post_theme',
    '#pre_render' => array(
      array(
        $class,
        'preRenderSocialPost',
      ),
    ),
    '#url' => NULL,
    '#placeholder' => NULL,
    '#attributes' => [
      'layout' => 'responsive',
      'width' => NULL,
      'height' => NULL,
      'data-embed-as' => 'post',
      'data-align-center' => NULL,
    ],
    '#attached' => [
      'library' => [
        'amp/runtime',
      ],
    ],
  );
}