You are here

public function WeMegaMenuAdminController::renderBlock in Drupal Mega Menu 8.x

Same name and namespace in other branches
  1. 8 src/Controller/WeMegaMenuAdminController.php \Drupal\we_megamenu\Controller\WeMegaMenuAdminController::renderBlock()

Render block from post variable ajax.

1 string reference to 'WeMegaMenuAdminController::renderBlock'
we_megamenu.routing.yml in ./we_megamenu.routing.yml
we_megamenu.routing.yml

File

src/Controller/WeMegaMenuAdminController.php, line 140

Class

WeMegaMenuAdminController
Controller routines for block example routes.

Namespace

Drupal\we_megamenu\Controller

Code

public function renderBlock() {
  $title = TRUE;
  if ($_POST['title'] == 0) {
    $title = FALSE;
  }
  if (isset($_POST['bid']) && isset($_POST['section']) && !empty($_POST['bid'])) {
    echo WeMegaMenuBuilder::renderBlock($_POST['bid'], $title, isset($_POST['section']));
  }
  else {
    echo '';
  }
  exit;
}