function Routes::isJsonApiRequest
Same name in other branches
- 9 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::isJsonApiRequest()
- 8.9.x core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::isJsonApiRequest()
- 10 core/modules/jsonapi/src/Routing/Routes.php \Drupal\jsonapi\Routing\Routes::isJsonApiRequest()
Determines if the given request is for a JSON:API generated route.
Parameters
array $defaults: The request's route defaults.
Return value
bool Whether the request targets a generated route.
2 calls to Routes::isJsonApiRequest()
- ResourceVersionRouteEnhancer::enhance in core/
modules/ jsonapi/ src/ Revisions/ ResourceVersionRouteEnhancer.php - Updates the defaults for a route definition based on the request.
- RouteEnhancer::enhance in core/
modules/ jsonapi/ src/ Routing/ RouteEnhancer.php - Updates the defaults for a route definition based on the request.
File
-
core/
modules/ jsonapi/ src/ Routing/ Routes.php, line 266
Class
- Routes
- Defines dynamic routes.
Namespace
Drupal\jsonapi\RoutingCode
public static function isJsonApiRequest(array $defaults) {
return isset($defaults[RouteObjectInterface::CONTROLLER_NAME]) && str_starts_with($defaults[RouteObjectInterface::CONTROLLER_NAME], static::CONTROLLER_SERVICE_NAME);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.