Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / views / src / Plugin / views / display / Embed.php
1 <?php
2
3 namespace Drupal\views\Plugin\views\display;
4
5 /**
6  * The plugin that handles an embed display.
7  *
8  * @ingroup views_display_plugins
9  *
10  * @todo: Wait until annotations/plugins support access methods.
11  * no_ui => !\Drupal::config('views.settings')->get('ui.show.display_embed'),
12  *
13  * @ViewsDisplay(
14  *   id = "embed",
15  *   title = @Translation("Embed"),
16  *   help = @Translation("Provide a display which can be embedded using the views api."),
17  *   theme = "views_view",
18  *   uses_menu_links = FALSE
19  * )
20  */
21 class Embed extends DisplayPluginBase {
22
23   /**
24    * {@inheritdoc}
25    */
26   protected $usesAttachments = TRUE;
27
28   /**
29    * {@inheritdoc}
30    */
31   public function buildRenderable(array $args = [], $cache = TRUE) {
32     $build = parent::buildRenderable($args, $cache);
33     $build['#embed'] = TRUE;
34     return $build;
35   }
36
37 }