public function run($id, $status)
    {
        $model = $this->findModel($id);
        $model->load(Yii::$app->request->post());
        $changedStatus = $model->sendToStatus($status);
        $model->save();

        return $this->response(
            $changedStatus,
            $model
        );
    }
public function run($id, $status)
    {
        $model = $this->findModel($id);
        $model->load(Yii::$app->request->post());
        $changedStatus = $model->sendToStatus($status);
        $model->save();

        return $this->response(
            $changedStatus,
            $model
        );
    }
public function run ( $ id , $ status ) { $ model = $ this -> findModel ( $ id ) ; $ model -> load ( Yii :: $ app -> request -> post ( ) ) ; $ changedStatus = $ model -> sendToStatus ( $ status ) ; $ model -> save ( ) ; return $ this -> response ( $ changedStatus , $ model ) ; }
Runs this action with the specified parameters.
This method is mainly invoked by the controller
@param  integer $id Id of model to find
@param  string $status status will change
@return closure object Preconfigured response
Runs this action with the specified parameters . This method is mainly invoked by the controller