Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. ViewExecutable.php

ViewExecutable::$element

A render array container to store render related information.

For example you can alter the array and attach some asset library or JS settings via the #attached key. This is the required way to add custom CSS or JS.

Type: array

See also

\Drupal\Core\Render\AttachmentsResponseProcessorInterface::processAttachments()

File

core/modules/views/src/ViewExecutable.php, line 447

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public $element = [
    '#attached' => [
        'library' => [
            'views/views.module',
        ],
        'drupalSettings' => [],
    ],
    '#cache' => [],
];

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal