Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RequestAttributeValueResolver.php

function RequestAttributeValueResolver::resolve

Overrides ValueResolverInterface::resolve

File

vendor/symfony/http-kernel/Controller/ArgumentResolver/RequestAttributeValueResolver.php, line 25

Class

RequestAttributeValueResolver
Yields a non-variadic argument's value from the request attributes.

Namespace

Symfony\Component\HttpKernel\Controller\ArgumentResolver

Code

public function resolve(Request $request, ArgumentMetadata $argument) : array {
    return !$argument->isVariadic() && $request->attributes
        ->has($argument->getName()) ? [
        $request->attributes
            ->get($argument->getName()),
    ] : [];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal