Ejemplo n.º 1
0
 public function actionEditFeature()
 {
     $feature_id = Yii::$app->request->post('feature_id');
     $feature_name = Yii::$app->request->post('feature_name');
     $metric_id = Yii::$app->request->post('metric_id');
     if (Yii::$app->getRequest()->isAjax && $feature_id && $feature_name) {
         $feature = Features::findOne($feature_id);
         $feature->name = $feature_name;
         if ($feature->feature_type == Features::RANGE_TYPE) {
             $feature->feature_metric_id = $metric_id;
         }
         return $feature->save();
     }
 }