function ParamConverterInterface::convert

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/ParamConverter/ParamConverterInterface.php \Drupal\Core\ParamConverter\ParamConverterInterface::convert()
  2. 10 core/lib/Drupal/Core/ParamConverter/ParamConverterInterface.php \Drupal\Core\ParamConverter\ParamConverterInterface::convert()

Converts path variables to their corresponding objects.

Parameters

mixed $value: The raw value.

mixed $definition: The parameter definition provided in the route options.

string $name: The name of the parameter.

array $defaults: The route defaults array.

Return value

mixed|null The converted parameter value.

4 methods override ParamConverterInterface::convert()
LanguageConverter::convert in core/modules/language/src/ProxyClass/LanguageConverter.php
Converts path variables to their corresponding objects.
LanguageConverter::convert in core/modules/language/src/LanguageConverter.php
Converts path variables to their corresponding objects.
LayoutSectionStorageParamConverter::convert in core/modules/layout_builder/src/Routing/LayoutSectionStorageParamConverter.php
Converts path variables to their corresponding objects.
ResourceTypeConverter::convert in core/modules/jsonapi/src/ParamConverter/ResourceTypeConverter.php
Converts path variables to their corresponding objects.

File

core/lib/Drupal/Core/ParamConverter/ParamConverterInterface.php, line 42

Class

ParamConverterInterface
Interface for parameter converters.

Namespace

Drupal\Core\ParamConverter

Code

public function convert($value, $definition, $name, array $defaults);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.