getQueryParam.php
Table of Contents
Functions
- getQueryParam() : mixed
- Retrieves a single parameter from the HTTP request query string.
Functions
getQueryParam()
Retrieves a single parameter from the HTTP request query string.
getQueryParam(ServerRequestInterface|null $request, string $name) : mixed
This helper extracts a value from the query parameters ($request->getQueryParams()),
supporting dot notation for nested structures (e.g. 'filter.page').
It internally uses hasKeyValue() and getKeyValue() from the
oihana\core\accessors namespace.
If the request is null, or if the specified parameter does not exist, the function returns null.
Parameters
- $request : ServerRequestInterface|null
-
The PSR-7 server request instance. If
null, no extraction is performed. - $name : string
-
The query parameter name or nested key path (e.g.
'filter.page').
Tags
Return values
mixed —The parameter value if found, or null otherwise.