function ParamConverterRouteRequirementInterface::getRouteRequirement
Returns a regex requirement for a route parameter.
Parameters
mixed $definition: The parameter definition provided in the route options.
string $name: The name of the parameter.
Return value
string|null A regex pattern (without delimiters or anchors) suitable for Route::setRequirement(), or NULL if no requirement can be determined.
1 method overrides ParamConverterRouteRequirementInterface::getRouteRequirement()
- EntityConverter::getRouteRequirement in core/
lib/ Drupal/ Core/ ParamConverter/ EntityConverter.php - Returns a regex requirement for a route parameter.
File
-
core/
lib/ Drupal/ Core/ ParamConverter/ ParamConverterRouteRequirementInterface.php, line 22
Class
- ParamConverterRouteRequirementInterface
- Interface for param converters providing a route requirement for parameters.
Namespace
Drupal\Core\ParamConverterCode
public function getRouteRequirement($definition, $name) : ?string;
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.