Request

Type
Class
Namespace
craft\console
Inherits
craft\console\Request » yii\console\Request » yii\base\Request » yii\base\Component » yii\base\BaseObject
Implements
yii\base\Configurable
Uses traits
craft\base\RequestTrait
Since
3.0

View source

Public Properties

PropertyDescription
$behaviorsyii\base\Behavior – List of behaviors attached to this component
$isActionRequestboolean
$isConsoleRequestboolean – The value indicating whether the current request is made via console
$isCpRequestboolean
$isLivePreviewboolean – Whether this is a Live Preview request.
$isSingleActionRequest
$isSiteRequestboolean
$paramsarray – The command line arguments.
$scriptFilestring – Entry script file path (processed w/ realpath())
$scriptFilenamestring

$isActionRequest

Type
boolean
Access
Read-only

View source

Signature

public boolean getIsActionRequest ( )

$isCpRequest

Type
boolean
Access
Read-only

View source

Signature

public boolean getIsCpRequest ( )

$isLivePreview

Type
boolean
Access
Read-only

Whether this is a Live Preview request.

View source

Signature

public boolean getIsLivePreview ( )

$isSingleActionRequest

Type

:

Access
Read-only

View source

Signature

public void getIsSingleActionRequest ( )

$isSiteRequest

Type
boolean
Access
Read-only

View source

Signature

public boolean getIsSiteRequest ( )

Public Methods

MethodDescription
__call()Calls the named method which is not a class method.
__clone()This method is called after the object is created by cloning an existing one.
__construct()Constructor.
__get()Returns the value of an object property.
__isset()Checks if a property is set, i.e. defined and not null.
__set()Sets value of an object property.
__unset()Sets an object property to null.
attachBehavior()Attaches a behavior to this component.
attachBehaviors()Attaches a list of behaviors to the component.
behaviors()Returns a list of behaviors that this component should behave as.
canGetProperty()Returns a value indicating whether a property can be read.
canSetProperty()Returns a value indicating whether a property can be set.
className()Returns the fully qualified name of this class.
detachBehavior()Detaches a behavior from the component.
detachBehaviors()Detaches all behaviors from the component.
ensureBehaviors()Makes sure that the behaviors declared in behaviors() are attached to this component.
getBehavior()Returns the named behavior object.
getBehaviors()Returns all behaviors attached to this component.
getIsActionRequest()Returns whether a specific controller action was requested. (Narrator: There wasn't.)
getIsConsoleRequest()Returns a value indicating whether the current request is made via command line.
getIsCpRequest()Returns whether the Control Panel was requested. (Narrator: It wasn't.)
getIsLivePreview()Returns whether this is a Live Preview request. (Narrator: It isn't.)
getIsSingleActionRequest()Returns whether the current request is solely an action request. (Narrator: It isn't.)
getIsSiteRequest()Returns whether the front end site was requested. (Narrator: It wasn't.)
getParams()Returns the command line arguments.
getScriptFile()Returns entry script file path.
getScriptFilename()Returns the requested script name being used to access Craft (e.g. “index.php”).
hasEventHandlers()Returns a value indicating whether there is any handler attached to the named event.
hasMethod()Returns a value indicating whether a method is defined.
hasProperty()Returns a value indicating whether a property is defined.
init()Initializes the object.
off()Detaches an existing event handler from this component.
on()Attaches an event handler to an event.
resolve()Resolves the current request into a route and the associated parameters.
setIsConsoleRequest()Sets the value indicating whether the current request is made via command line.
setParams()Sets the command line arguments.
setScriptFile()Sets the entry script file path.
trigger()Triggers an event.

getIsActionRequest()

Returns whether a specific controller action was requested. (Narrator: There wasn't.)

View source

Returns

boolean

Signature

public boolean getIsActionRequest ( )

getIsCpRequest()

Returns whether the Control Panel was requested. (Narrator: It wasn't.)

View source

Returns

boolean

Signature

public boolean getIsCpRequest ( )

getIsLivePreview()

Returns whether this is a Live Preview request. (Narrator: It isn't.)

View source

Returns

boolean – Whether this is a Live Preview request.

Signature

public boolean getIsLivePreview ( )

getIsSingleActionRequest()

Returns whether the current request is solely an action request. (Narrator: It isn't.)

View source

Signature

public void getIsSingleActionRequest ( )

getIsSiteRequest()

Returns whether the front end site was requested. (Narrator: It wasn't.)

View source

Returns

boolean

Signature

public boolean getIsSiteRequest ( )

init()

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the given configuration.

View source

Signature

public void init ( )