You are here

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

Builds the Drupal 8 definition for the route, without making any changes to the original module or callback.

Return value

Drupal8\RouteWrapper

Overrides ContentRoute::buildRouteDefinition

File

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

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 buildRouteDefinition(TargetInterface $target, RouteWrapper $route) {
  $definition = parent::buildRouteDefinition($target, $route);
  $definition
    ->setDefault('_form', $this
    ->getController($target, $route)
    ->getName()
    ->getAbsolutePath());
  return $definition;
}