symfonyrole

how to get the currently logged in role symfony?


I want to get the Role of the user currently logged. Because I want to show that in my navbar can somebody help me?

My question is about how to get the current role


Solution

  • If I remember well, you can get roles in twig by doing {{ app.user && app.user.roles }} but you will get an array of roles.

    Hope it helps.