You are here

public static function Reference::routes in FileField Sources 8

Define routes for Reference source.

Return value

array Array of routes.

File

src/Plugin/FilefieldSource/Reference.php, line 180

Class

Reference
A FileField source plugin to allow referencing of existing files.

Namespace

Drupal\filefield_sources\Plugin\FilefieldSource

Code

public static function routes() {
  $routes = [];
  $routes['filefield_sources.autocomplete'] = new Route('/file/reference/{entity_type}/{bundle_name}/{field_name}', [
    '_controller' => get_called_class() . '::autocomplete',
  ], [
    '_access_filefield_sources_field' => 'TRUE',
  ]);
  return $routes;
}