-
Notifications
You must be signed in to change notification settings - Fork 1
ServerRequest: withCookieParams Example
Terry L edited this page Jun 20, 2020
·
1 revision
Shieldon\Psr7\ServerRequest
Extends Request.
Return an instance with the specified cookies.
-
param
array
cookies*
Array of key/value pairs representing cookies. -
return
static
Example:
$serverRequests = $serverRequests->withCookieParams([
'foo' => 'baz',
'yes' => 'I do',
]);
$cookieParams = $serverRequests->getCookieParams();
print(print_r($cookieParams, true));
/* Outputs:
Array
(
[foo] => baz
[yes] => I do
)
*/
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.