我知道这是个愚蠢的问题,但我刚开始用Yii2学习。我在这里没有找到任何有用的信息,所以。如果用户成功地被添加到数据库中,我需要做的就是显示一条消息。能帮我解决这个问题吗?actionCreate() $model = new Employee();
if ($model->load($post) &&
下面的代码在SiteController中可以很好地使用echo,但不能使用yii-method setflash()。也许,我必须重新配置我的配置文件(main-local.php)?::$app->session->setFlash('success', 'File has been uploaded');
echo "<font size='4'>$model->fil
book_id')$checkmodel = Books::find()->where(['book_id' => $book_id])->one();
Yii::$app->session->setFlash('error', 'The book has been borrowed, Please look for another one.');return $this
function actionFunction4() $this->layout="sintel"; \Yii::$app->getSession()->setFlash('success', 'successfully got on to the payment page');
return= Yii::$app
在使用函数Yii::$app->setFlash()时,我遇到了一些奇怪的事情。不会保留该值。beforeAction($action) //Evaluate some condition then fire Yii::$app->session->setFlash('error', "this is