PHP Class WhToggleAction

Works in conjunction with WhToggleColumn widget in order to ease the task of the developer to update the the attribute displayed on the grid. Just attach to the controller you wish to make the calls to.
Author: Antonio Ramirez ([email protected])
Inheritance: extends CAction
Datei anzeigen Open project: 2amigos/yiiwheels

Public Properties

Property Type Description
$additionalCriteriaOnLoadModel additional criteria to use to get the model
$ajaxResponseOnFailed the response to return to an AJAX call when failed to update the attribute.
$ajaxResponseOnSuccess the response to return to an AJAX call when the attribute was successfully saved.
$exceptionOnNullModel whether to throw an exception if we cannot find a model requested by the id
$modelName the name of the model we are going to toggle values to
$noValue the value to update the model to [yes|no]
$redirectRoute the route to redirect the call after updating attribute
$yesValue the value to update the model to [yes|no] standard toggle options, but you can toggle any value.

Public Methods

Method Description
run ( integer $id, string $attribute ) Widgets run function

Protected Methods

Method Description
loadModel ( integer $id ) : CActiveRecord Loads the requested data model.

Method Details

loadModel() protected method

Loads the requested data model.
protected loadModel ( integer $id ) : CActiveRecord
$id integer the model ID
return CActiveRecord the model instance.

run() public method

Widgets run function
public run ( integer $id, string $attribute )
$id integer
$attribute string

Property Details

$additionalCriteriaOnLoadModel public_oe property

additional criteria to use to get the model
public $additionalCriteriaOnLoadModel

$ajaxResponseOnFailed public_oe property

the response to return to an AJAX call when failed to update the attribute.
public $ajaxResponseOnFailed

$ajaxResponseOnSuccess public_oe property

the response to return to an AJAX call when the attribute was successfully saved.
public $ajaxResponseOnSuccess

$exceptionOnNullModel public_oe property

whether to throw an exception if we cannot find a model requested by the id
public $exceptionOnNullModel

$modelName public_oe property

the name of the model we are going to toggle values to
public $modelName

$noValue public_oe property

the value to update the model to [yes|no]
public $noValue

$redirectRoute public_oe property

the route to redirect the call after updating attribute
public $redirectRoute

$yesValue public_oe property

the value to update the model to [yes|no] standard toggle options, but you can toggle any value.
public $yesValue