You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.
Currently, the key of the message is probably mainly used for the corresponding category "warning, info, danger, success". However, if you now have two forms in the page, the evaluation of this information and the output is a bit tricky. It would be nice if you can add the corresponding form name in addition to the key.
currently:
$flashMessages->flash('danger', 'You need to supply your email address');
suggestion:
$flashMessages->flash('danger', 'You need to supply your email address', 'form-name'); // OR$flashMessages->flash('form-name:danger', 'You need to supply your email address');
$flashMessages->getFlashByForm('form-name');
What do you all mean?
The text was updated successfully, but these errors were encountered:
I have been thinking about this as well and currently use it something like $flashMessages->flash('form-name:danger', 'message');.
$flashMessages->getFlashByForm('form-name');
I wouldn't call it getFlashByForm. I rather would like to see something like getFlashByNamespace. It does the same but it's more general.
$flashMessages->flash('danger', 'You need to supply your email address', 'form-name');
This cannot happen without a BC break. The current signature is public function flash(string $key, $value, int $hops = 1) : void;. So you would have something like public function flash(string $key, $value, int $hops = 1, string $namespace = null) : void;.
However I think I rather see something like this: public function flash(string $namespace, $value, int $hops = 1, array options = null) : void;,
where options can be anything. You can add your message level (error, danger, success), form name, field name or whatever you want. To make it even more powerful, a namespace could have multiple messages.
public function getMessagesForNamespace(string $namespace) : array;
Currently, the key of the message is probably mainly used for the corresponding category "warning, info, danger, success". However, if you now have two forms in the page, the evaluation of this information and the output is a bit tricky. It would be nice if you can add the corresponding form name in addition to the key.
currently:
suggestion:
What do you all mean?
The text was updated successfully, but these errors were encountered: