Embed.php

Same filename and directory in other branches
  1. 9 core/modules/views/src/Plugin/views/display/Embed.php
  2. 8.9.x core/modules/views/src/Plugin/views/display/Embed.php
  3. 10 core/modules/views/src/Plugin/views/display/Embed.php

Namespace

Drupal\views\Plugin\views\display

File

core/modules/views/src/Plugin/views/display/Embed.php

View source
<?php

namespace Drupal\views\Plugin\views\display;

use Drupal\Core\StringTranslation\TranslatableMarkup;
use Drupal\views\Attribute\ViewsDisplay;

/**
 * The plugin that handles an embed display.
 *
 * @ingroup views_display_plugins
 *
 * @todo Wait until annotations/plugins support access methods.
 *   no_ui => !\Drupal::config('views.settings')->get('ui.show.display_embed'),
 */
class Embed extends DisplayPluginBase {
    
    /**
     * {@inheritdoc}
     */
    protected $usesAttachments = TRUE;
    
    /**
     * {@inheritdoc}
     */
    public function buildRenderable(array $args = [], $cache = TRUE) {
        $build = parent::buildRenderable($args, $cache);
        $build['#embed'] = TRUE;
        return $build;
    }

}

Classes

Title Deprecated Summary
Embed The plugin that handles an embed display.

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