public function actionExecute($id) { $model = Condition::one($id); $return = Condition::execute($id); $session = Yii::$app->session; if (true === $return) { Yii::$app->session->setFlash('success', Yii::t('app', 'Yes {name} !', ['name' => $model->name])); } elseif (false === $return) { Yii::$app->session->setFlash('warning', Yii::t('app', 'No {name} !', ['name' => $model->name])); } else { Yii::$app->session->setFlash('info', Yii::t('app', '{name} = {return} !', ['name' => $model->name, 'return' => $return])); } return $this->redirect(['condition/index']); }