public static function getRequestParameterValue(Request $request, $path)
    {
        if (false === $pos = strpos($path, '[')) {
            return $request->get($path);
        }

        $root = substr($path, 0, $pos);

        if (null === $value = $request->get($root)) {
            return;
        }

        if (null === self::$propertyAccessor) {
            self::$propertyAccessor = PropertyAccess::createPropertyAccessor();
        }

        try {
            return self::$propertyAccessor->getValue($value, substr($path, $pos));
        } catch (AccessException $e) {
            return;
        }
    }
public static function getRequestParameterValue(Request $request, $path)
    {
        if (false === $pos = strpos($path, '[')) {
            return $request->get($path);
        }

        $root = substr($path, 0, $pos);

        if (null === $value = $request->get($root)) {
            return;
        }

        if (null === self::$propertyAccessor) {
            self::$propertyAccessor = PropertyAccess::createPropertyAccessor();
        }

        try {
            return self::$propertyAccessor->getValue($value, substr($path, $pos));
        } catch (AccessException $e) {
            return;
        }
    }
public static function getRequestParameterValue ( Request $ request , $ path ) { if ( false === $ pos = strpos ( $ path , '[' ) ) { return $ request -> get ( $ path ) ; } $ root = substr ( $ path , 0 , $ pos ) ; if ( null === $ value = $ request -> get ( $ root ) ) { return ; } if ( null === self :: $ propertyAccessor ) { self :: $ propertyAccessor = PropertyAccess :: createPropertyAccessor ( ) ; } try { return self :: $ propertyAccessor -> getValue ( $ value , substr ( $ path , $ pos ) ) ; } catch ( AccessException $ e ) { return ; } }
Returns a request "parameter" value.

Paths like foo[bar] will be evaluated to find deeper items in nested data structures.

@param Request $request The request
@param string  $path    The key

@return mixed

@throws InvalidArgumentException when the given path is malformed
Returns a request parameter value .