You are here

class FacRoutes in Fast Autocomplete 8

Defines a route subscriber to register a url for service fac json files.

Hierarchy

Expanded class hierarchy of FacRoutes

File

src/Routing/FacRoutes.php, line 11

Namespace

Drupal\fac\Routing
View source
class FacRoutes {

  /**
   * Returns an array of route objects.
   *
   * @return \Symfony\Component\Routing\Route[]
   *   An array of route objects.
   */
  public function routes() {
    $routes['fac.json'] = new Route(PublicStream::basePath() . '/fac-json/{fac_config_id}/{langcode}/{hash}/{key}', [
      '_controller' => '\\Drupal\\fac\\Controller\\FacController::generateJson',
    ], [
      '_permission' => 'access content',
      'fac_config_id' => '.*?',
      'langcode' => '^[a-z]{2,3}(?:-[A-Z]{2,3}(?:-[a-zA-Z]{4})?)?$',
      'hash' => '.*?',
      'key' => '.*?\\.json$',
    ]);
    return $routes;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FacRoutes::routes public function Returns an array of route objects.