[ 'class' => 'yii\web\ErrorAction', ], ]; } /** * Displays homepage. * * @return string */ public function actionIndex() { $computation_result = new ComputationResult(); $deck_form = new DeckForm(); if ($deck_form->load(Yii::$app->request->post())) { if ($deck_form->validate()) { $computation_result = $deck_form->compute(); } } return $this->render('index', [ 'deck_form' => $deck_form, 'result' => $computation_result, ]); } }