function StaticTest::alterRouteDefinition

Same name in other branches
  1. 9 core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php \Drupal\views_test_data\Plugin\views\access\StaticTest::alterRouteDefinition()
  2. 10 core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php \Drupal\views_test_data\Plugin\views\access\StaticTest::alterRouteDefinition()
  3. 11.x core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php \Drupal\views_test_data\Plugin\views\access\StaticTest::alterRouteDefinition()

Overrides AccessPluginBase::alterRouteDefinition

File

core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php, line 37

Class

StaticTest
Tests a static access plugin.

Namespace

Drupal\views_test_data\Plugin\views\access

Code

public function alterRouteDefinition(Route $route) {
    if (!empty($this->options['access'])) {
        $route->setRequirement('_access', 'TRUE');
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.