You are here

public function WeMegaMenuAdminController::saveConfigWeMegaMenu in Drupal Mega Menu 8

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

A function ajax save menu config.

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

File

src/Controller/WeMegaMenuAdminController.php, line 88

Class

WeMegaMenuAdminController
Controller routines for block example routes.

Namespace

Drupal\we_megamenu\Controller

Code

public function saveConfigWeMegaMenu() {
  if (isset($_POST['action']) && $_POST['action'] == 'save') {
    $data_config = $_POST['data_config'];
    $theme = $_POST['theme'];
    $menu_name = $_POST['menu_name'];
    WeMegaMenuBuilder::saveConfig($menu_name, $theme, $data_config);
    we_megamenu_flush_render_cache();
  }
  exit;
}