class FilefieldSourcesRoutes in FileField Sources 8
Defines a route subscriber to register a url for serving filefield sources.
Hierarchy
- class \Drupal\filefield_sources\Routing\FilefieldSourcesRoutes
Expanded class hierarchy of FilefieldSourcesRoutes
File
- src/
Routing/ FilefieldSourcesRoutes.php, line 8
Namespace
Drupal\filefield_sources\RoutingView source
class FilefieldSourcesRoutes {
/**
* Returns an array of route objects.
*
* @return \Symfony\Component\Routing\Route[]
* An array of route objects.
*/
public function routes() {
$routes = [];
foreach (\Drupal::service('filefield_sources')
->getDefinitions() as $definition) {
// Get routes defined by each plugin.
$callback = [
$definition['class'],
'routes',
];
if (is_callable($callback)) {
$routes = array_merge($routes, call_user_func($callback));
}
}
return $routes;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
FilefieldSourcesRoutes:: |
public | function | Returns an array of route objects. |