ServerRequest::getAttribute( $attribute,  $default = null ): mixed

In this article

Return

mixed

Source

public function getAttribute($attribute, $default = null)
{
    if (!\is_string($attribute)) {
        throw new \InvalidArgumentException('Attribute name must be a string');
    }
    if (\false === \array_key_exists($attribute, $this->attributes)) {
        return $default;
    }
    return $this->attributes[$attribute];
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.