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

Breadcrumb

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

function ViewExecutable::initStyle

Finds and initializes 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.

Return value

bool TRUE if the style plugin was or could be initialized, FALSE otherwise.

4 calls to ViewExecutable::initStyle()
ViewExecutable::build in core/modules/views/src/ViewExecutable.php
Builds the query for the view.
ViewExecutable::getStyle in core/modules/views/src/ViewExecutable.php
Gets the current style plugin.
ViewExecutable::getTitle in core/modules/views/src/ViewExecutable.php
Gets the view's current title.
ViewExecutable::render in core/modules/views/src/ViewExecutable.php
Renders this view for a certain display.

File

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

Class

ViewExecutable
Represents a view as a whole.

Namespace

Drupal\views

Code

public function initStyle() {
    if (isset($this->style_plugin)) {
        return TRUE;
    }
    $this->style_plugin = $this->display_handler
        ->getPlugin('style');
    if (empty($this->style_plugin)) {
        return FALSE;
    }
    return TRUE;
}

API Navigation

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