Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AJAX flashing! #3

Open
pratyushpundir opened this issue Jul 31, 2016 · 2 comments
Open

AJAX flashing! #3

pratyushpundir opened this issue Jul 31, 2016 · 2 comments
Labels

Comments

@pratyushpundir
Copy link

pratyushpundir commented Jul 31, 2016

How would you Flash messages using AJAX in such a setup? I wish to Flash error messages from my Controllers that use this structure without having to reload. The flashing itself works but the page needs to be reloaded in order to display the message.

Unfortunately, October's way of doing this by returning a partial does not work here. I have attempted this:

throw new AjaxException(['#flashMessages' => $this->renderPartial(...)]);

But I still need to reload. Any suggestions?

@daftspunk
Copy link
Member

A flash message isn't really an exception, so just return it

return ['#flashMessages' => $this->renderPartial(...)];

@jc91715
Copy link

jc91715 commented May 20, 2017

I use this

   $this->middleware('guest')

has error

   Class guest does not exist

how to use Middleware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants