ParamConverterManager

Manages converter services for converting request parameters to full objects. A typical use case for this would be upcasting (converting) a node id to a node entity. Hierarchy class \Drupal\Core\ParamConverter\ParamConverterManager implements ParamConverterManagerInterface File core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php, line 14 Namespace Drupal\Core\ParamConverter Members Name Modifiers Type Description ParamConverterManager::$converters protected prope

ParamConverterInterface::convert

public ParamConverterInterface::convert($value, $definition, $name, array $defaults) 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. File core/lib/Drupal/Core/ParamConverter/ParamConverterInterface.php, line 42 Class ParamConverter

ParamConverterInterface::applies

public ParamConverterInterface::applies($definition, $name, Route $route) Determines if the converter applies to a specific route and variable. Parameters mixed $definition: The parameter definition provided in the route options. string $name: The name of the parameter. \Symfony\Component\Routing\Route $route: The route to consider attaching to. Return value bool TRUE if the converter applies to the passed route and parameter, FALSE otherwise. File core/lib/Drupal/Core/ParamConverter/ParamCon

ParamConverterInterface

Interface for parameter converters. Classes implementing this interface are responsible for converting a path parameter to the object it represents. Here is an example path: /admin/structure/block/manage/{block} In this case, '{block}' would be the path parameter which should be turned into a block object representing the block in question. ParamConverters are defined as services tagged with 'paramconverter', and are managed by the 'paramconverter_manager' service. Hierarchy interface \Drupal\C

ParamConversionEnhancer::__construct

public ParamConversionEnhancer::__construct(ParamConverterManagerInterface $param_converter_manager) Constructs a new ParamConversionEnhancer. Parameters \Drupal\Core\ParamConverter\ParamConverterManagerInterface $param_converter_manager: The parameter conversion manager. File core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php, line 34 Class ParamConversionEnhancer Provides a route enhancer that handles parameter conversion. Namespace Drupal\Core\Routing\Enhancer Code p

ParamConversionEnhancer::onException

public ParamConversionEnhancer::onException(GetResponseForExceptionEvent $event) Catches failed parameter conversions and throw a 404 instead. Parameters \Symfony\Component\HttpKernel\Event\GetResponseForExceptionEvent $event: File core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php, line 77 Class ParamConversionEnhancer Provides a route enhancer that handles parameter conversion. Namespace Drupal\Core\Routing\Enhancer Code public function onException(GetResponseForExcep

ParamConversionEnhancer::getSubscribedEvents

public static ParamConversionEnhancer::getSubscribedEvents() Returns an array of event names this subscriber wants to listen to. The array keys are event names and the value can be: The method name to call (priority defaults to 0) An array composed of the method name to call and the priority An array of arrays composed of the method names to call and respective priorities, or 0 if unset For instance: array('eventName' => 'methodName') array('eventName' => array('methodName', $priority

ParamConversionEnhancer::enhance

public ParamConversionEnhancer::enhance(array $defaults, Request $request) Update the defaults based on its own data and the request. Parameters array $defaults the getRouteDefaults array.: Request $request the Request instance.: Return value array the modified defaults. Each enhancer MUST return the $defaults but may add or remove values. Overrides RouteEnhancerInterface::enhance File core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php, line 41 Class ParamConversionEnhancer

ParamConversionEnhancer::copyRawVariables

protected ParamConversionEnhancer::copyRawVariables(array $defaults) Store a backup of the raw values that corresponding to the route pattern. Parameters array $defaults: The route defaults array. Return value \Symfony\Component\HttpFoundation\ParameterBag File core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php, line 58 Class ParamConversionEnhancer Provides a route enhancer that handles parameter conversion. Namespace Drupal\Core\Routing\Enhancer Code protected functi

ParamConversionEnhancer::applies

public ParamConversionEnhancer::applies(Route $route) Declares if the route enhancer applies to the given route. 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 RouteEnhancerInterface::applies File core/lib/Drupal/Core/Routing/Enhancer/ParamConversionEnhancer.php, line 95 Class ParamConversionEnhancer Provides a route enhancer that handles parameter conversi