You are here

trait PageBreadcrumbsFormTrait in Panels Breadcrumbs 8

Trait PageBreadcrumbsFormTrait.

@package Drupal\panels_breadcrumbs\Form

Hierarchy

File

src/Form/PageBreadcrumbsFormTrait.php, line 12

Namespace

Drupal\panels_breadcrumbs\Form
View source
trait PageBreadcrumbsFormTrait {

  /**
   * Get panels breadcrumbs settings keys.
   */
  public static function getSettingsKeys() {
    return [
      'state',
      'titles',
      'paths',
      'home',
      'home_text',
    ];
  }

  /**
   * Get types of tokens based on contexts.
   */
  public static function getTypesOfTokens(PageVariantInterface $page_variant) {
    $types = [];
    foreach ($page_variant
      ->getContexts() as $id => $context) {
      if ($type = \Drupal::service('token.entity_mapper')
        ->getTokenTypeForEntityType($id)) {
        $types[] = $type;
      }
    }
    return $types;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PageBreadcrumbsFormTrait::getSettingsKeys public static function Get panels breadcrumbs settings keys.
PageBreadcrumbsFormTrait::getTypesOfTokens public static function Get types of tokens based on contexts.