public function ViewsMenuLink::loadView in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/Menu/ViewsMenuLink.php \Drupal\views\Plugin\Menu\ViewsMenuLink::loadView()
Initializes the proper view.
Return value
\Drupal\views\ViewExecutable The view executable.
1 call to ViewsMenuLink::loadView()
- ViewsMenuLink::updateLink in core/
modules/ views/ src/ Plugin/ Menu/ ViewsMenuLink.php - Updates the definition values for a menu link.
File
- core/
modules/ views/ src/ Plugin/ Menu/ ViewsMenuLink.php, line 100 - Contains \Drupal\views\Plugin\Menu\ViewsMenuLink.
Class
- ViewsMenuLink
- Defines menu links provided by views.
Namespace
Drupal\views\Plugin\MenuCode
public function loadView() {
if (empty($this->view)) {
$metadata = $this
->getMetaData();
$view_id = $metadata['view_id'];
$display_id = $metadata['display_id'];
$view_entity = $this->entityManager
->getStorage('view')
->load($view_id);
$view = $this->viewExecutableFactory
->get($view_entity);
$view
->setDisplay($display_id);
$view
->initDisplay();
$this->view = $view;
}
return $this->view;
}