首页 > yii2是如何实现将错误信息传过去的?

yii2是如何实现将错误信息传过去的?

比如说,一个我在IndexController/actionCreate方法里。
实现添加数据的操作,想将添加成功或者失败的信息携带给另一个页面,以什么形式携带信息比较好?


使用 flash

文档参考 http://www.getyii.com/doc-2.0/guide/runtime-sessions-cookies.html#flash-data

代码参考 https://github.com/iiYii/getyii/blob/master/frontend%2Fmodules%2Ftopic%2Fcontrollers%2FDefaultController.php#L168

【热门文章】
【热门文章】