You are here

protected function StaticContextConfigure::getParentRouteInfo in Page Manager 8.4

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

Document the route name and parameters for redirect after submission.

Parameters

$cached_values:

Return value

array In the format of return ['route.name', ['machine_name' => $this->machine_name, 'step' => 'step_name]];

Overrides ContextConfigure::getParentRouteInfo

File

page_manager_ui/src/Form/StaticContextConfigure.php, line 39

Class

StaticContextConfigure

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' => 'contexts',
      ],
    ];
  }
  else {
    $page_variant = $this
      ->getPageVariant($cached_values);
    return [
      'entity.page.edit_form',
      [
        'machine_name' => $this->machine_name,
        'step' => 'page_variant__' . $page_variant
          ->id() . '__contexts',
      ],
    ];
  }
}