You are here

public function ViewExecutable::initStyle in Views (for Drupal 7) 8.3

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 lib/Drupal/views/ViewExecutable.php
Build the query for the view.
ViewExecutable::getTitle in lib/Drupal/views/ViewExecutable.php
Get the view's current title. This can change depending upon how it was built.
ViewExecutable::render in lib/Drupal/views/ViewExecutable.php
Render this view for a certain display.

File

lib/Drupal/views/ViewExecutable.php, line 678
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 = views_get_plugin('style', $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;
}