You are here

public function ChartsPluginDisplayChart::attachTo in Charts 8

Same name and namespace in other branches
  1. 8.4 src/Plugin/views/display/ChartsPluginDisplayChart.php \Drupal\charts\Plugin\views\display\ChartsPluginDisplayChart::attachTo()
  2. 8.3 src/Plugin/views/display/ChartsPluginDisplayChart.php \Drupal\charts\Plugin\views\display\ChartsPluginDisplayChart::attachTo()
  3. 5.0.x src/Plugin/views/display/ChartsPluginDisplayChart.php \Drupal\charts\Plugin\views\display\ChartsPluginDisplayChart::attachTo()

Allows displays to attach to other views.

Parameters

\Drupal\views\ViewExecutable $view: The views executable.

string $display_id: The display to attach to.

array $build: The parent view render array.

Overrides Attachment::attachTo

File

src/Plugin/views/display/ChartsPluginDisplayChart.php, line 154
Contains the Chart display type (similar to Page, Block, Attachment, etc.)

Class

ChartsPluginDisplayChart
Display plugin to attach multiple chart configurations to the same chart.

Namespace

Drupal\charts\Plugin\views\display

Code

public function attachTo(ViewExecutable $view, $display_id, array &$build) {
  $displays = $this
    ->getOption('displays');
  if (empty($displays[$display_id])) {
    return;
  }
  if (!$this
    ->access()) {
    return;
  }
}