You are here

public static function WeMegaMenuBuilder::renderView in Drupal Mega Menu 8

Same name and namespace in other branches
  1. 8.x src/WeMegaMenuBuilder.php \Drupal\we_megamenu\WeMegaMenuBuilder::renderView()

Render all drupal view.

File

src/WeMegaMenuBuilder.php, line 735

Class

WeMegaMenuBuilder

Namespace

Drupal\we_megamenu

Code

public static function renderView() {
  $entity_manager = Drupal::entityTypeManager();
  $views = $entity_manager
    ->getStorage('view')
    ->loadMultiple();
  foreach ($views as $key => $view) {
    $view = Views::getView($key);
    $a = $view
      ->render();
    if ($a) {
      echo \Drupal::service('renderer')
        ->render($view);
      exit;
    }
  }
}