You are here

public function TacLiteSchemes::routes in Taxonomy Access Control Lite 8

1 string reference to 'TacLiteSchemes::routes'
tac_lite.routing.yml in ./tac_lite.routing.yml
tac_lite.routing.yml

File

src/Routing/TacLiteSchemes.php, line 14

Class

TacLiteSchemes
Defines a route subscriber to register a url for serving Schemes.

Namespace

Drupal\tac_lite\Routing

Code

public function routes() {
  $routes = [];
  $config = \Drupal::config('tac_lite.settings');
  $schemes = $config
    ->get('tac_lite_schemes');
  for ($i = 1; $i <= $schemes; $i++) {
    $routes['tac_lite.scheme_' . $i] = new Route('/admin/config/people/tac_lite/scheme_' . $i, [
      '_form' => '\\Drupal\\tac_lite\\Form\\SchemeForm',
      '_title' => 'Access by Taxonomy',
      'scheme' => $i,
    ], [
      '_permission' => 'administer tac_lite',
    ]);
  }
  return $routes;
}