function AttributeRouteDiscovery::getAttributes
Same name and namespace in other branches
- main core/lib/Drupal/Core/Routing/AttributeRouteDiscovery.php \Drupal\Core\Routing\AttributeRouteDiscovery::getAttributes()
Gets the PHP attributes.
Parameters
\ReflectionClass|\ReflectionMethod $reflection: The reflected class or method.
Return value
iterable<int, RouteAttribute> The attributes.
1 call to AttributeRouteDiscovery::getAttributes()
- AttributeRouteDiscovery::createRouteCollection in core/
lib/ Drupal/ Core/ Routing/ AttributeRouteDiscovery.php - Creates a route collection from a class's attributed methods.
File
-
core/
lib/ Drupal/ Core/ Routing/ AttributeRouteDiscovery.php, line 283
Class
- AttributeRouteDiscovery
- Discovers routes using Symfony's Route attribute.
Namespace
Drupal\Core\RoutingCode
private function getAttributes(\ReflectionClass|\ReflectionMethod $reflection) : iterable {
foreach ($reflection->getAttributes(RouteAttribute::class, \ReflectionAttribute::IS_INSTANCEOF) as $attribute) {
yield $attribute->newInstance();
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.