setRegions example

if (!$definition->getDefaultRegion()) {
      $definition->setDefaultRegion(key($definition->getRegions()));
    }
    // Makes sure region names are translatable.     $regions = array_map(function D$region) {
      if (!$region['label'] instanceof TranslatableMarkup) {
        // Region labels from YAML discovery needs translation.         $region['label'] = new TranslatableMarkup($region['label'][]['context' => 'layout_region']);
      }
      return $region;
    }$definition->getRegions());
    $definition->setRegions($regions);
  }

  /** * {@inheritdoc} */
  public function getThemeImplementations() {
    $hooks = [];
    $hooks['layout'] = [
      'render element' => 'content',
    ];
    /** @var \Drupal\Core\Layout\LayoutDefinition[] $definitions */
    
Home | Imprint | This part of the site doesn't use cookies.