You are here

public function RelationshipConfigure::ajaxSave in Chaos Tool Suite (ctools) 8.3

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

Return value

\Drupal\Core\Ajax\AjaxResponse

File

src/Form/RelationshipConfigure.php, line 113

Class

RelationshipConfigure

Namespace

Drupal\ctools\Form

Code

public function ajaxSave(array &$form, FormStateInterface $form_state) {
  $cached_values = $this->tempstore
    ->get($this->tempstore_id)
    ->get($this->machine_name);
  list($route_name, $route_parameters) = $this
    ->getParentRouteInfo($cached_values);
  $response = new AjaxResponse();
  $url = Url::fromRoute($route_name, $route_parameters);
  $response
    ->addCommand(new RedirectCommand($url
    ->toString()));
  $response
    ->addCommand(new CloseModalDialogCommand());
  return $response;
}