Skip to content
PHP Ecosystem
Explore

Response

API reference › yii › base › Response

classyii\base\Response
ExtendsComponent » BaseObject
ImplementsConfigurable
Since2.0
Sourceframework/base/Response.php
2 subclasses

Response represents the response of an Application to a Request.

For more details and usage information on Response, see the guide article on responses.

PropertyTypeDescriptionDefined by
$behaviors read-onlyarray<Behavior<static>>List of behaviors attached to this component.Component
$exitStatusintThe exit status. Default: 0.Response
MethodDescriptionDefined by
__construct()Constructor.BaseObject
__call()Calls the named method which is not a class method.Component
__clone()This method is called after the object is created by cloning an existing one.Component
__get()Returns the value of a component property.Component
__isset()Checks if a property is set, i.e. defined and not null.Component
__set()Sets the value of a component property.Component
__unset()Sets a component property to be null.Component
attachBehavior()Attaches a behavior to this component.Component
attachBehaviors()Attaches a list of behaviors to the component.Component
behaviors()Returns a list of behaviors that this component should behave as.Component
canGetProperty()Returns a value indicating whether a property can be read.Component
canSetProperty()Returns a value indicating whether a property can be set.Component
className() staticReturns the fully qualified name of this class.BaseObject
clearOutputBuffers()Removes all existing output buffers.Response
detachBehavior()Detaches a behavior from the component.Component
detachBehaviors()Detaches all behaviors from the component.Component
ensureBehaviors()Makes sure that the behaviors declared in behaviors() are attached to this component.Component
getBehavior()Returns the named behavior object.Component
getBehaviors()Returns all behaviors attached to this component.Component
hasEventHandlers()Returns a value indicating whether there is any handler attached to the named event.Component
hasMethod()Returns a value indicating whether a method is defined.Component
hasProperty()Returns a value indicating whether a property is defined for this component.Component
init()Initializes the object.BaseObject
off()Detaches an existing event handler from this component.Component
on()Attaches an event handler to an event.Component
send()Sends the response to client.Response
trigger()Triggers an event.Component
public int $exitStatus = 0

The exit status.

Exit statuses should be in the range 0 to 254. The status 0 means the program terminates successfully.

public function clearOutputBuffers(): mixed

Removes all existing output buffers.

Returns

mixed

public function send(): mixed

Sends the response to client.

Returns

mixed