5 * Contains \Drupal\filefield_sources\Routing\FilefieldSourcesRoutes.
8 namespace Drupal\filefield_sources\Routing;
11 * Defines a route subscriber to register a url for serving filefield sources.
13 class FilefieldSourcesRoutes {
16 * Returns an array of route objects.
18 * @return \Symfony\Component\Routing\Route[]
19 * An array of route objects.
21 public function routes() {
24 foreach (\Drupal::service('filefield_sources')->getDefinitions() as $definition) {
25 // Get routes defined by each plugin.
26 $callback = array($definition['class'], 'routes');
27 if (is_callable($callback)) {
28 $routes = array_merge($routes, call_user_func($callback));