Home  >  Article  >  Backend Development  >  在symfony2里如何使用setFlash??

在symfony2里如何使用setFlash??

WBOY
WBOYOriginal
2016-06-06 20:32:251043browse

在symfony2里如何使用setFlash??我使用时,一直有错误。而且不大会用setFlash。。

回复内容:

在symfony2里如何使用setFlash??我使用时,一直有错误。而且不大会用setFlash。。

Symfony2 的控制器里直接 addFlash 就行了:

<code>$this->addFlash('notice', 'Notice Message');
</code>

详细请看 107 行:

https://github.com/symfony/symfony/blob/2.8/src/Symfony/Bundle/Framewo...

你是如何做的,遇到了什么错误,尝试过的解决办法,都细细道来!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn