function ViewExecutable::initDisplay

Same name in other branches
  1. 9 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::initDisplay()
  2. 8.9.x core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::initDisplay()
  3. 10 core/modules/views/src/ViewExecutable.php \Drupal\views\ViewExecutable::initDisplay()

Sets the display for this view and initializes the display handler.

Return value

true Always returns TRUE.

12 calls to ViewExecutable::initDisplay()
ViewExecutable::access in core/modules/views/src/ViewExecutable.php
Determines if the given user has access to the view.
ViewExecutable::buildTitle in core/modules/views/src/ViewExecutable.php
Forces the view to build a title.
ViewExecutable::chooseDisplay in core/modules/views/src/ViewExecutable.php
Gets the first display that is accessible to the user.
ViewExecutable::getCacheTags in core/modules/views/src/ViewExecutable.php
Gets the cache tags associated with the executed view.
ViewExecutable::getDisplay in core/modules/views/src/ViewExecutable.php
Gets the current display plugin.

... See full list

File

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

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function initDisplay() {
    if (isset($this->current_display)) {
        return TRUE;
    }
    // Initialize the display cache array.
    $this->displayHandlers = new DisplayPluginCollection($this, $this->displayPluginManager);
    $this->current_display = 'default';
    $this->display_handler = $this->displayHandlers
        ->get('default');
    return TRUE;
}

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