You are here

public function FormRoute::buildRoute in Drupal 7 to 8/9 Module Upgrader 8

Builds the Drupal 8 route, making any needed changes to the original module and/or callback.

Overrides ContentRoute::buildRoute

File

src/Plugin/DMU/Routing/FormRoute.php, line 90

Class

FormRoute
Plugin annotation @Converter( id = "drupal_get_form", description = @Translation("Converts a drupal_get_form() menu item to a _form route."), dependencies = { "router.route_provider", "plugin.manager.drupalmoduleupgrader.rewriter",…

Namespace

Drupal\drupalmoduleupgrader\Plugin\DMU\Routing

Code

public function buildRoute(TargetInterface $target, RouteWrapper $route) {
  $controller = $this->formConverter
    ->get($target, $route['page arguments'][0])
    ->build();
  $target
    ->getIndexer('class')
    ->addFile($this
    ->writeClass($target, $controller));
}