Skip to content

RequestTrait ​

Type
Trait
Namespace
craft\base
Implemented by
craft\console\Request, craft\web\Request
Since
3.0.0

Request trait.

This provides request methods that are common between craft\web\Request and craft\console\Request.

View source

Public Properties ​

PropertyDescription
isWebAliasSetDynamicallyboolean
isWebRequestboolean – Whether this is a web request.
isWebrootAliasSetDynamicallyboolean
scriptFilenamestring – The requested script name being used to access Craft (e.g. “index.php”).

isWebAliasSetDynamically ​

Type
boolean
Default value
false

View source

isWebRequest ​

Type
boolean
Default value
null

Whether this is a web request.

View source

isWebrootAliasSetDynamically ​

Type
boolean
Default value
false

View source

scriptFilename ​

Type
string
Default value
null

The requested script name being used to access Craft (e.g. “index.php”).

View source

Public Methods ​

MethodDescription
getIsWebRequest()Returns whether this is a web request.
getScriptFilename()Returns the requested script name being used to access Craft (e.g. “index.php”).

getIsWebRequest() ​

Since
5.5.0

Returns whether this is a web request.

View source

Returns ​

boolean

getScriptFilename() ​

Returns the requested script name being used to access Craft (e.g. “index.php”).

View source

Returns ​

string

Throws ​