\TbToggleAction

## TbToggleAction CAction Component

It is a component that works in conjunction of TbToggleColumn widget. Just attach to the controller you wish to make the calls to.

Summary

Methods
Properties
Constants
run()
$modelName
$exceptionOnNullModel
$additionalCriteriaOnLoadModel
$redirectRoute
$yesValue
$noValue
$ajaxResponseOnSuccess
$ajaxResponseOnFailed
No constants found
loadModel()
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$modelName

$modelName : string

Type

string — the name of the model we are going to toggle values to

$exceptionOnNullModel

$exceptionOnNullModel : bool

Type

bool — whether to throw an exception if we cannot find a model requested by the id

$additionalCriteriaOnLoadModel

$additionalCriteriaOnLoadModel : array

Type

array — additional criteria to use to get the model

$redirectRoute

$redirectRoute : mixed

Type

mixed — the route to redirect the call after updating attribute

$yesValue

$yesValue : int|string

Type

int|string — the value to update the model to [yes|no] standard toggle options, but you can toggle any value.

$noValue

$noValue : int|string

Type

int|string — the value to update the model to [yes|no]

$ajaxResponseOnSuccess

$ajaxResponseOnSuccess : mixed

Type

mixed — the response to return to an AJAX call when the attribute was successfully saved.

$ajaxResponseOnFailed

$ajaxResponseOnFailed : mixed

Type

mixed — the response to return to an AJAX call when failed to update the attribute.

Methods

run()

run()

Widgets run function

Throws

\CHttpException

loadModel()

loadModel(integer $id) : \CActiveRecord

Loads the requested data model.

Parameters

integer $id

the model ID

Throws

\CHttpException

if the model cannot be found

Returns

\CActiveRecord —

the model instance.