controllers/ItemController.php
public function actionActivate($id, $active)
    {
        $model = Item::findOne($id);
        $model->attributes = compact('active');
        $model->save();
    }
public function actionActivate($id, $active)
    {
        $model = Item::findOne($id);
        $model->attributes = compact('active');
        $model->save();
    }
public function actionActivate ( $ id , $ active ) { $ model = Item :: findOne ( $ id ) ; $ model -> attributes = compact ( 'active' ) ; $ model -> save ( ) ; }
Activates/deactivates model.
@param integer $id model id.
@param integer 1/0 $active whether to activate model.
Activates / deactivates model .