public function DefinedTestAccessCheck::applies

Declares whether the access check applies to a specific route or not.

Parameters

\Symfony\Component\Routing\Route $route: The route to consider attaching to.

Return value

bool TRUE if the check applies to the passed route, FALSE otherwise.

Overrides AccessCheckInterface::applies

File

drupal/core/modules/system/tests/modules/router_test/lib/Drupal/router_test/Access/DefinedTestAccessCheck.php, line 22
Contains \Drupal\router_test\Access\DefinedTestAccessCheck.

Class

DefinedTestAccessCheck
Defines an access checker similar to DefaultAccessCheck

Namespace

Drupal\router_test\Access

Code

public function applies(Route $route) {
  return array_key_exists('_test_access', $route
    ->getRequirements());
}