You are here

class TacLiteSchemes in Taxonomy Access Control Lite 8

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

Hierarchy

Expanded class hierarchy of TacLiteSchemes

File

src/Routing/TacLiteSchemes.php, line 10

Namespace

Drupal\tac_lite\Routing
View source
class TacLiteSchemes {

  /**
   * {@inheritdoc}
   */
  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;
  }

}

Members