Skip to content
This repository has been archived by the owner on Aug 21, 2021. It is now read-only.

Add support for easy flashes handling #2

Merged
merged 1 commit into from
Aug 12, 2019

Conversation

sstok
Copy link
Contributor

@sstok sstok commented Aug 12, 2019

It's a common practice to show a flash message after a redirect, rather than having to get a session manually (ensuring its started) you can use now use the withFlash() method.

Example:

return RouteRedirectResponse::toRoute('park_manager.client_section.webhosting.account.ftp.user_list')
                ->withFlash('success', 'translation.id', 'arguments');

When the arguments are empty (null) the message is past added to FlashBag as a string, otherwise it's an array like ['message' => 'message.id' => ['id' => 200]].

Translations and special formatting must still be done in the template.

@sstok sstok merged commit feee373 into rollerworks-graveyard:master Aug 12, 2019
@sstok sstok deleted the feature/flashes branch August 12, 2019 18:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant