modules/api/v2/controllers/ColorController.php
/**
     * Updates an existing Color model.
     * If update is successful, the browser will be redirected to the 'view' page.
     * @param integer $id
     * @return mixed
     * @throws NotFoundHttpException if the model cannot be found
     */
Updates an existing Color model.
If update is successful, the browser will be redirected to the 'view' page.
@param integer $id
@return mixed
@throws NotFoundHttpException if the model cannot be found
Updates an existing Color model . If update is successful the browser will be redirected to the ' view ' page . @param integer $id @return mixed @throws NotFoundHttpException if the model cannot be found
public function actionUpdate($id)
    {
        $model = Color::findOne($id);
        if (!$model instanceof Color) {
            throw new NotFoundHttpException('Color doesn\'t exist.');
        }
        $postData = Yii::$app->request->post();
        $colorData['Color'] = $postData;
        if ($model->load($colorData) && $model->validate()) {
            $model->save(false);
        }
        return $model;
    }
public function actionUpdate ( $ id ) { $ model = Color :: findOne ( $ id ) ; if ( ! $ model instanceof Color ) { throw new NotFoundHttpException ( 'Color doesn\'t exist.' ) ; } $ postData = Yii :: $ app -> request -> post ( ) ; $ colorData [ 'Color' ] = $ postData ; if ( $ model -> load ( $ colorData ) && $ model -> validate ( ) ) { $ model -> save ( false ) ; } return $ model ; }
Updates an existing Color model.
Updates an existing Color model .