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

Renderfeedbackmessages #847

Closed
chan007 opened this issue Feb 26, 2017 · 2 comments
Closed

Renderfeedbackmessages #847

chan007 opened this issue Feb 26, 2017 · 2 comments

Comments

@chan007
Copy link

chan007 commented Feb 26, 2017

What do I do if I have to render feedback messages at multiple at multiple places in the view? In my case, I have a footer on my web page which has a contact us section. So the notification, of a mail being sent or not, must be displayed there. Also, in the login section, if the user mistypes a password or something, I have to display the error messages on the same page. Any pointers would be appreciated. Thank you.

@sr-verde
Copy link
Contributor

That is easy to implement…

You have to introduce a new feedback-class for each position like that:
Session::add('feedback_negative_position', Text::get('FEEDBACK_NOTE_CREATION_FAILED'));

Print out the feedback messages at each position like that:

$feedback_negative = Session::get('feedback_negative_position');

// echo out negative messages
if (isset($feedback_negative)) {
    foreach ($feedback_negative as $feedback) {
        echo '<div class="feedback error">'.$feedback.'</div>';
    }
}

@chan007
Copy link
Author

chan007 commented Mar 1, 2017

I figured it out. Thank you.

@chan007 chan007 closed this as completed Mar 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants