Quantcast
Channel: Active questions tagged symfony4 - Stack Overflow
Viewing all articles
Browse latest Browse all 3925

Symfony 5 > Display Roles as "human readable"

$
0
0

I want set up Symfony 5 to use "human readable" roles for display purposes. When displaying user information in TWIG I can use {{ user.roles[0] }}. However, this displays (for example) "ROLE_ACCOUNTADMIN" (as is saved against the user in the database), but I would like it to display as "Account Administrator". With Symfony 3 where a user_roles table was used, there was a "role" and a "name" field, but this has been removed. Is it possible to accomplish this in Symfony 5 without having to define / include an array whenever I want to use this?


Viewing all articles
Browse latest Browse all 3925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>