You are here

protected function PageVariantSelectionForm::getOperationsRouteInfo in Page Manager 8

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

Document the route name and parameters for edit/delete context operations.

The route name returned from this method is used as a "base" to which ".edit" and ".delete" are appended in the getOperations() method. Subclassing '\Drupal\ctools\Form\ConditionConfigure' and '\Drupal\ctools\Form\ConditionDelete' should set you up for using this approach quite seamlessly.

Parameters

mixed $cached_values:

string $machine_name:

string $row:

Return value

array In the format of return ['route.base.name', ['machine_name' => $machine_name, 'context' => $row]];

Overrides ManageConditions::getOperationsRouteInfo

1 call to PageVariantSelectionForm::getOperationsRouteInfo()
PageVariantSelectionForm::add in page_manager_ui/src/Form/PageVariantSelectionForm.php

File

page_manager_ui/src/Form/PageVariantSelectionForm.php, line 42
Contains \Drupal\page_manager_ui\Form\PageVariantSelectionForm.

Class

PageVariantSelectionForm

Namespace

Drupal\page_manager_ui\Form

Code

protected function getOperationsRouteInfo($cached_values, $machine_name, $row) {

  /** @var \Drupal\page_manager\PageVariantInterface $page_variant */
  $page_variant = $cached_values['page_variant'];
  return [
    'entity.page_variant.condition',
    [
      'machine_name' => $machine_name,
      'variant_machine_name' => $page_variant
        ->id(),
      'condition' => $row,
    ],
  ];
}