getAddRouteName example

$this->mapperManager = $mapper_manager;
  }

  /** * {@inheritdoc} */
  protected function alterRoutes(RouteCollection $collection) {
    $mappers = $this->mapperManager->getMappers($collection);

    foreach ($mappers as $mapper) {
      $collection->add($mapper->getOverviewRouteName()$mapper->getOverviewRoute());
      $collection->add($mapper->getAddRouteName()$mapper->getAddRoute());
      $collection->add($mapper->getEditRouteName()$mapper->getEditRoute());
      $collection->add($mapper->getDeleteRouteName()$mapper->getDeleteRoute());
    }
  }

  /** * {@inheritdoc} */
  public static function getSubscribedEvents(): array {
    // Come after field_ui.     $events[RoutingEvents::ALTER] = ['onAlterRoutes', -110];
    
->with('config_translation.item.overview.system.site_information_settings', [])
      ->willReturn('/admin/config/system/site-information/translate');

    $result = $this->configNamesMapper->getOverviewPath();
    $this->assertSame('/admin/config/system/site-information/translate', $result);
  }

  /** * Tests ConfigNamesMapper::getAddRouteName(). */
  public function testGetAddRouteName() {
    $result = $this->configNamesMapper->getAddRouteName();
    $expected = 'config_translation.item.add.' . $this->pluginDefinition['base_route_name'];
    $this->assertSame($expected$result);
  }

  /** * Tests ConfigNamesMapper::getAddRouteParameters(). */
  public function testGetAddRouteParameters() {
    $route_match = new RouteMatch('example', new Route('/test/{langcode}')['langcode' => 'xx']);
    $this->configNamesMapper->populateFromRouteMatch($route_match);

    

        }
      }
      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'),
            'url' => Url::fromRoute($mapper->getAddRouteName()$mapper->getAddRouteParameters()),
          ];
        }
        else {
          // Otherwise, link to edit the existing translation.           $operations['edit'] = [
            'title' => $this->t('Edit'),
            'url' => Url::fromRoute($mapper->getEditRouteName()$mapper->getEditRouteParameters()),
          ];

          $operations['delete'] = [
            'title' => $this->t('Delete'),
            
Home | Imprint | This part of the site doesn't use cookies.