modules/api/v1/controllers/ColorController.php
/**
     * Creates a new Color model.
     * If creation is successful, the browser will be redirected to the 'view' page.
     * @return mixed
     */
Creates a new Color model.
If creation is successful, the browser will be redirected to the 'view' page.
@return mixed
Creates a new Color model . If creation is successful the browser will be redirected to the ' view ' page . @return mixed
public function actionCreate()
    {
        $model = new Color();
        $postData = Yii::$app->request->post();
        $colorData['Color'] = $postData;
        if ($model->load($colorData) && $model->validate()) {
            $model->save();
        }
        return $model;
    }
public function actionCreate ( ) { $ model = new Color ( ) ; $ postData = Yii :: $ app -> request -> post ( ) ; $ colorData [ 'Color' ] = $ postData ; if ( $ model -> load ( $ colorData ) && $ model -> validate ( ) ) { $ model -> save ( ) ; } return $ model ; }
Creates a new Color model.
Creates a new Color model .