/** * Creates board * @return array|\yii\web\Response */ public function actionCreate() { //TODO: Check authorization. $board = new Board(); $board->scenario = Board::SCENARIO_CREATE; if ($board->load(\Yii::$app->request->post()) && $board->validate()) { if ($board->save()) { \Yii::$app->response->setStatusCode(201); // TODO: we need to return full entity, not just name return $this->actionGet($board->name); } } return $board->errors; }