entity_embed-8.x-1.x-dev/tests/modules/entity_embed_test/src/Routing/RouteSubscriber.php

tests/modules/entity_embed_test/src/Routing/RouteSubscriber.php
<?php

declare(strict_types=1);

namespace Drupal\entity_embed_test\Routing;

use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\entity_embed_test\Controller\TestEntityEmbedController;
use Symfony\Component\Routing\RouteCollection;

/**
 * Listens to the dynamic route events.
 */
class RouteSubscriber extends RouteSubscriberBase {

  /**
   * {@inheritdoc}
   */
  public function alterRoutes(RouteCollection $collection) {
    if ($route = $collection->get('embed.preview')) {
      $route->setDefault('_controller', TestEntityEmbedController::class . '::preview');
    }
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc