Yiiboster Toggle Column

Hi everyone, I have a question about Yiibooster Toggle Column (TbToggleColumn). I don’t understand how should I customize this part of the example:

This means I should add an action called “actions” inside of my controller? Let’s say my view file reads like this:




    'type' => 'striped bordered',

    'dataProvider' => new CActiveDataProvider('Region', array('criteria' => array('condition' => 'id<5'))),

    'template' => "{items}",

    'columns' => array(

    array('name' => 'country_code', 'header' => 'Country Code'),

    array('name' => 'name', 'header' => 'Region Name'),


    'class' => 'bootstrap.widgets.TbToggleColumn',

    'toggleAction' => 'example/toggle',

    'name' => 'status',

    'header' => 'Toggle'





how should I replace “example/toggle”? I’m confused :)

To whoever it may concern, I found out by myself:

  1. Yes, you must add a method called "actions" in your controller.

  2. You should set view and mentioned method as the following:

Column in view file


            'class' => 'bootstrap.widgets.TbToggleColumn',

            'toggleAction' => 'myModel/toggle',

            'name' => 'myAttribute',

            'header' => 'Some text'


Actions method in myModelController

public function actions()


    	return array(

    		'toggle' => array(


    			'modelName' => 'myModel',




Cheers ::)