getBaseRouteParameters example


  protected function processRoute(Route $route) {
  }

  /** * {@inheritdoc} */
  public function getBasePath() {
    return Url::fromRoute($this->getBaseRouteName()$this->getBaseRouteParameters())->getInternalPath();
  }

  /** * {@inheritdoc} */
  public function getOverviewRouteName() {
    return 'config_translation.item.overview.' . $this->getBaseRouteName();
  }

  /** * {@inheritdoc} */
/** * Loaded entity instance to help produce the translation interface. * * @var \Drupal\field\FieldConfigInterface */
  protected $entity;

  /** * {@inheritdoc} */
  public function getBaseRouteParameters() {
    $parameters = parent::getBaseRouteParameters();
    $base_entity_info = $this->entityTypeManager->getDefinition($this->pluginDefinition['base_entity_type']);
    $bundle_parameter_key = $base_entity_info->getBundleEntityType() ?: 'bundle';
    $parameters[$bundle_parameter_key] = $this->entity->getTargetBundle();
    return $parameters;
  }

  /** * {@inheritdoc} */
  public function getOverviewRouteName() {
    return 'entity.field_config.config_translation_overview.' . $this->pluginDefinition['base_entity_type'];
  }

  public function testGetBaseRouteName() {
    $result = $this->configNamesMapper->getBaseRouteName();
    $this->assertSame($this->pluginDefinition['base_route_name']$result);
  }

  /** * Tests ConfigNamesMapper::getBaseRouteParameters(). */
  public function testGetBaseRouteParameters() {
    $result = $this->configNamesMapper->getBaseRouteParameters();
    $this->assertSame([]$result);
  }

  /** * Tests ConfigNamesMapper::getBaseRoute(). */
  public function testGetBaseRoute() {
    $result = $this->configNamesMapper->getBaseRoute();
    $this->assertSame($this->baseRoute, $result);
  }

  
$language_name = '<strong>' . $this->t('@language (original)', ['@language' => $language->getName()]) . '</strong>';

        // Check access for the path/route for editing, so we can decide to         // include a link to edit or not.         $edit_access = $this->accessManager->checkNamedRoute($mapper->getBaseRouteName()$route_match->getRawParameters()->all()$this->account);

        // Build list of operations.         $operations = [];
        if ($edit_access) {
          $operations['edit'] = [
            'title' => $this->t('Edit'),
            'url' => Url::fromRoute($mapper->getBaseRouteName()$mapper->getBaseRouteParameters()['query' => ['destination' => $mapper->getOverviewPath()]]),
          ];
        }
      }
      else {
        $language_name = $language->getName();

        $operations = [];
        // If no translation exists for this language, link to add one.         if (!$mapper->hasTranslation($language)) {
          $operations['add'] = [
            'title' => $this->t('Add'),
            
Home | Imprint | This part of the site doesn't use cookies.