You are here

public function GridStackVariantFormController::selection in GridStack 8.2

Returns the variant selection.

1 string reference to 'GridStackVariantFormController::selection'
gridstack_ui.routing.yml in modules/gridstack_ui/gridstack_ui.routing.yml
modules/gridstack_ui/gridstack_ui.routing.yml

File

modules/gridstack_ui/src/Controller/GridStackVariantFormController.php, line 158

Class

GridStackVariantFormController
Provides controller to load GridStackVariantForm.

Namespace

Drupal\gridstack_ui\Controller

Code

public function selection($gridstack, $gid) {
  $pub = $this->request->query
    ->get('pub', NULL);
  $vid = $this->request->query
    ->get('vid', NULL);
  $id = $gridstack
    ->id();
  $form = $this
    ->formBuilder()
    ->getForm('Drupal\\gridstack_ui\\Form\\GridStackVariantSelectionForm', $id, $gid, $vid, $pub);
  $response = new AjaxResponse();
  $response
    ->addCommand(new HtmlCommand('#' . GridStackDefault::variantWrapperId($gid), $form));
  return $response;
}