-
Notifications
You must be signed in to change notification settings - Fork 1
ServerRequest: withAttribute Example
Terry L edited this page Jun 18, 2020
·
3 revisions
Extends Request.
-
param
string
name*
The attribute name. -
param
mixed
value*
The value of the attribute. -
return
static
Example:
$serverRequest = $serverRequest->withAttribute('ip_address', '19.89.6.4');
$ip = $serverRequest->getAttribute('ip_address');
echo $ip
// Outputs: 19.89.6.4
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.