You are here

protected function ParameterEditForm::getParentRouteInfo in Page Manager 8

Same name and namespace in other branches
  1. 8.4 page_manager_ui/src/Form/ParameterEditForm.php \Drupal\page_manager_ui\Form\ParameterEditForm::getParentRouteInfo()

Returns the parent route to redirect after form submission.

Return value

array Array containing the route name and its parameters.

1 call to ParameterEditForm::getParentRouteInfo()
ParameterEditForm::submitForm in page_manager_ui/src/Form/ParameterEditForm.php
Form submission handler.

File

page_manager_ui/src/Form/ParameterEditForm.php, line 215
Contains \Drupal\page_manager_ui\Form\ParameterEditForm.

Class

ParameterEditForm
Provides a form for editing a parameter.

Namespace

Drupal\page_manager_ui\Form

Code

protected function getParentRouteInfo($cached_values) {

  /** @var $page \Drupal\page_manager\PageInterface */
  $page = $cached_values['page'];
  if ($page
    ->isNew()) {
    return [
      'entity.page.add_step_form',
      [
        'machine_name' => $this->machine_name,
        'step' => 'parameters',
      ],
    ];
  }
  else {
    return [
      'entity.page.edit_form',
      [
        'machine_name' => $this->machine_name,
        'step' => 'parameters',
      ],
    ];
  }
}