class DevelGenerateRoutes in Devel 8
Same name and namespace in other branches
- 8.3 devel_generate/src/Routing/DevelGenerateRoutes.php \Drupal\devel_generate\Routing\DevelGenerateRoutes
- 8.2 devel_generate/src/Routing/DevelGenerateRoutes.php \Drupal\devel_generate\Routing\DevelGenerateRoutes
- 4.x devel_generate/src/Routing/DevelGenerateRoutes.php \Drupal\devel_generate\Routing\DevelGenerateRoutes
Provides dynamic routes for devel_generate.
Hierarchy
- class \Drupal\devel_generate\Routing\DevelGenerateRoutes implements ContainerInjectionInterface
Expanded class hierarchy of DevelGenerateRoutes
File
- devel_generate/
src/ Routing/ DevelGenerateRoutes.php, line 13
Namespace
Drupal\devel_generate\RoutingView source
class DevelGenerateRoutes implements ContainerInjectionInterface {
/**
* Constructs a new devel_generate route subscriber.
*
* @param \Drupal\Component\Plugin\PluginManagerInterface $devel_generate_manager
* The DevelGeneratePluginManager.
*/
public function __construct(PluginManagerInterface $devel_generate_manager) {
$this->DevelGenerateManager = $devel_generate_manager;
}
/**
* {@inheritdoc}
*/
public static function create(ContainerInterface $container) {
return new static($container
->get('plugin.manager.develgenerate'));
}
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;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DevelGenerateRoutes:: |
public static | function |
Instantiates a new instance of this class. Overrides ContainerInjectionInterface:: |
|
DevelGenerateRoutes:: |
public | function | ||
DevelGenerateRoutes:: |
public | function | Constructs a new devel_generate route subscriber. |