You are here

public function ViewStorage::newDisplay in Views (for Drupal 7) 8.3

Creates a new display and a display handler for it.

Parameters

string $plugin_id: (optional) The plugin type from the Views plugin annotation. Defaults to 'page'.

string $title: (optional) The title of the display. Defaults to NULL.

string $id: (optional) The ID to use, e.g., 'default', 'page_1', 'block_2'. Defaults to NULL.

Return value

Drupal\views\Plugin\views\display\DisplayPluginBase A reference to the new handler object.

File

lib/Drupal/views/ViewStorage.php, line 327
Definition of Drupal\views\ViewStorage.

Class

ViewStorage
Defines a ViewStorage configuration entity class.

Namespace

Drupal\views

Code

public function &newDisplay($plugin_id = 'page', $title = NULL, $id = NULL) {
  $id = $this
    ->addDisplay($plugin_id, $title, $id);
  return $this
    ->getExecutable()
    ->newDisplay($id);
}