public function actionUpdate($id) { $model = new CategoryForm(); if (isset($_POST['CategoryForm'])) { $model->attributes = $_POST['CategoryForm']; if ($model->validate()) { $model->save(); $this->redirect(array('index')); } } else { $model->loadDataFromCategory($id); } $statuses = array(0 => Yii::t('common', 'Disabled'), 1 => Yii::t('common', 'Enabled')); $stores = CHtml::listData(Store::model()->findAll(), 'store_id', 'name'); $stores[0] = Yii::t('store', 'Default'); $this->render('update', array('model' => $model, 'stores' => $stores, 'statuses' => $statuses)); }