public function DevelGenerateRoutes::routes in Devel 8
Same name and namespace in other branches
- 8.3 devel_generate/src/Routing/DevelGenerateRoutes.php \Drupal\devel_generate\Routing\DevelGenerateRoutes::routes()
- 8.2 devel_generate/src/Routing/DevelGenerateRoutes.php \Drupal\devel_generate\Routing\DevelGenerateRoutes::routes()
- 4.x devel_generate/src/Routing/DevelGenerateRoutes.php \Drupal\devel_generate\Routing\DevelGenerateRoutes::routes()
1 string reference to 'DevelGenerateRoutes::routes'
- devel_generate.routing.yml in devel_generate/
devel_generate.routing.yml - devel_generate/devel_generate.routing.yml
File
- devel_generate/
src/ Routing/ DevelGenerateRoutes.php, line 34
Class
- DevelGenerateRoutes
- Provides dynamic routes for devel_generate.
Namespace
Drupal\devel_generate\RoutingCode
public function routes() {
$devel_generate_plugins = $this->DevelGenerateManager
->getDefinitions();
$routes = array();
foreach ($devel_generate_plugins as $id => $plugin) {
$label = $plugin['label'];
$type_url_str = str_replace('_', '-', $plugin['url']);
$routes["devel_generate.{$id}"] = new Route("admin/config/development/generate/{$type_url_str}", array(
'_form' => '\\Drupal\\devel_generate\\Form\\DevelGenerateForm',
'_title' => "Generate {$label}",
'_plugin_id' => $id,
), array(
'_permission' => $plugin['permission'],
));
}
return $routes;
}