public function ViewExecutable::initStyle

Find and initialize the style plugin.

Note that arguments may have changed which style plugin we use, so check the view object first, then ask the display handler.

3 calls to ViewExecutable::initStyle()
ViewExecutable::build in drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php
Build the query for the view.
ViewExecutable::getTitle in drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php
Get the view's current title. This can change depending upon how it was built.
ViewExecutable::render in drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php
Render this view for a certain display.

File

drupal/core/modules/views/lib/Drupal/views/ViewExecutable.php, line 701
Definition of Drupal\views\ViewExecutable.

Class

ViewExecutable
An object to contain all of the data to generate a view, plus the member functions to build the view query, execute the query and render the output.

Namespace

Drupal\views

Code

public function initStyle() {
  if (isset($this->style_plugin)) {
    return is_object($this->style_plugin);
  }
  if (!isset($this->plugin_name)) {
    $style = $this->display_handler
      ->getOption('style');
    $this->plugin_name = $style['type'];
    $this->style_options = $style['options'];
  }
  $this->style_plugin = drupal_container()
    ->get("plugin.manager.views.style")
    ->createInstance($this->plugin_name);
  if (empty($this->style_plugin)) {
    return FALSE;
  }

  // init the new style handler with data.
  $this->style_plugin
    ->init($this, $this->display_handler, $this->style_options);
  return TRUE;
}