You are here

public function ViewsPhp::alterRouteDefinition in Views PHP 8

Allows access plugins to alter the route definition of a view.

Likely the access plugin will add new requirements, so its custom access checker can be applied.

Parameters

\Symfony\Component\Routing\Route $route: The route to change.

Overrides AccessPluginBase::alterRouteDefinition

File

src/Plugin/views/access/ViewsPhp.php, line 87
Definition of Drupal\views_php\Plugin\views\access\ViewsPhp.

Class

ViewsPhp
Access plugin that provides access based on PHP code.

Namespace

Drupal\views_php\Plugin\views\access

Code

public function alterRouteDefinition(Route $route) {
  $route
    ->setRequirement('_access', 'TRUE');
}