TestRouteSubscriber.php in Devel 8.3
File
tests/modules/devel_test/src/Routing/TestRouteSubscriber.php
View source
<?php
namespace Drupal\devel_test\Routing;
use Drupal\Core\Routing\RouteSubscriberBase;
use Drupal\Core\State\State;
use Symfony\Component\Routing\RouteCollection;
class TestRouteSubscriber extends RouteSubscriberBase {
protected $state;
public function __construct(State $state) {
$this->state = $state;
}
protected function alterRoutes(RouteCollection $collection) {
$this->state
->set('devel_test_route_rebuild', 'Router rebuild fired');
}
}