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
Very often you would only need one message of a certain key ; or you know 100% there is only one. If that is the case its mega overhead to be doing array looping/checking in your display code.
Can we introduce something like this?
class V6Messages extends \Slim\Flash\Messages {
public function getFirstMessage($key) {
$messages = self::getMessage($key);
if(is_array($messages) && count($messages)>0) {
return $messages[0];
}
return null;
}
}
After that you can just use
{{$messages->getFirstMessage('key')}}
in your template code nice and clean.
The text was updated successfully, but these errors were encountered:
Very often you would only need one message of a certain key ; or you know 100% there is only one. If that is the case its mega overhead to be doing array looping/checking in your display code.
Can we introduce something like this?
After that you can just use
in your template code nice and clean.
The text was updated successfully, but these errors were encountered: