Symfony2 and FOS User Bundle issue...
I have implemented my own login form in the head of the page (using FOS User Bundle as per directions in http://forum.symfony-project.org/viewtopic.php?f=31&t=37767.)
Now, I have the error message
Variable "csrf_token" does not exist in ::base.html.twig
Someone else on that forum (url above) had the exact same issue, and resolved it by putting in the hidden csrf field like this
<input type="hidden" name="_csrf_token" value="{{ csrf_token }}" />
My problem though is: that works fine when on the /login path, but my whole point is not needing that separate login page, I want my form integrated in the page head always, and it seems that the {{csrf_token}} is only available when the page is rendered by the login controller...
Also, how do I get the error messages (flashes) in there, I assume I must include the login controller in my defaultController somehow, to get all those variables with it every time, or...? Or should I instead render the userBundle controller in that portion of the header instead of pasting some of the userBundle template into my head?