Codex PHP
A PHP library for building HTML and CSS UI components using Codex, the Wikimedia design system.
Loading...
Searching...
No Matches
Wikimedia\Codex\Adapter\WebRequestAdapter Class Reference
+ Inheritance diagram for Wikimedia\Codex\Adapter\WebRequestAdapter:

Public Member Functions

 __construct (object $request)
 Constructor for WebRequestAdapter.
 
 getVal (string $name, $default=null)
 Fetch a value from the request.
 

Protected Attributes

object $request
 

Constructor & Destructor Documentation

◆ __construct()

Wikimedia\Codex\Adapter\WebRequestAdapter::__construct ( object $request)

Constructor for WebRequestAdapter.

This constructor initializes the adapter with the given request object. The request object must provide a getVal method that retrieves request parameters.

Since
0.1.0
Parameters
object$requestThe request object to adapt.

Member Function Documentation

◆ getVal()

Wikimedia\Codex\Adapter\WebRequestAdapter::getVal ( string $name,
$default = null )

Fetch a value from the request.

This method retrieves the value of a specific parameter from the underlying request object. If the parameter is not present, the provided default value will be returned.

Since
0.1.0
Parameters
string$nameThe name of the parameter to fetch.
mixed$defaultThe default value to return if the parameter is not set in the request. Defaults to null.
Returns
mixed The value of the parameter, or the $default value if the parameter is not set.

Implements Wikimedia\Codex\Contract\IWebRequest.


The documentation for this class was generated from the following file: