You are here

protected function StaticContextConfigure::getPageVariant in Page Manager 8

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

Get the page variant.

Parameters

array $cached_values: The cached values from the wizard.

Return value

\Drupal\page_manager\PageVariantInterface

3 calls to StaticContextConfigure::getPageVariant()
StaticContextConfigure::addContext in page_manager_ui/src/Form/StaticContextConfigure.php
Custom logic for adding a context to the cached_values contexts array.
StaticContextConfigure::getContexts in page_manager_ui/src/Form/StaticContextConfigure.php
Custom logic for retrieving the contexts array from cached_values.
StaticContextConfigure::getParentRouteInfo in page_manager_ui/src/Form/StaticContextConfigure.php
Document the route name and parameters for redirect after submission.

File

page_manager_ui/src/Form/StaticContextConfigure.php, line 31
Contains \Drupal\page_manager_ui\Form\StaticContextConfigure.

Class

StaticContextConfigure

Namespace

Drupal\page_manager_ui\Form

Code

protected function getPageVariant($cached_values) {
  if (isset($cached_values['page_variant'])) {
    return $cached_values['page_variant'];
  }

  /** @var $page \Drupal\page_manager\PageInterface */
  $page = $cached_values['page'];
  return $page
    ->getVariant($this->variantMachineName);
}