symfony - How to set symfony2 flash message in diferente Aplication Context? -


i have application frontend(sales) , backend(administration), want set flash messages separated context, because when i'm login in both context i'm received in backend messages belong frontend, , don't want it.

sorry english i'm not english speaker. king regards

if using sessions flash bag need use different names when adding message. example use following admin messages:

// in controller $this->get('session')->getflashbag()   ->add('admin_error','no user found email address');  .........................................................  {# in template #} {% flashmessage in app.session.flashbag.get('admin_error') %}   <div class="error-message">{{ flashmessage }}</div> {% endfor %} 

then same thing in public controllers/templates replace 'admin_error' 'public_error'.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -