ResponsiveImage.php

Same filename in other branches
  1. 9 core/modules/responsive_image/src/Element/ResponsiveImage.php
  2. 10 core/modules/responsive_image/src/Element/ResponsiveImage.php
  3. 11.x core/modules/responsive_image/src/Element/ResponsiveImage.php

Namespace

Drupal\responsive_image\Element

File

core/modules/responsive_image/src/Element/ResponsiveImage.php

View source
<?php

namespace Drupal\responsive_image\Element;

use Drupal\Core\Render\Element\RenderElement;

/**
 * Provides a responsive image element.
 *
 * @RenderElement("responsive_image")
 */
class ResponsiveImage extends RenderElement {
    
    /**
     * {@inheritdoc}
     */
    public function getInfo() {
        return [
            '#theme' => 'responsive_image',
            '#attached' => [
                'library' => [
                    'core/picturefill',
                ],
            ],
        ];
    }

}

Classes

Title Deprecated Summary
ResponsiveImage Provides a responsive image element.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.