How to load parameters with different values based on user role in Symfony?

How to load parameters with different values based on user role in Symfony?

I have a multitude of parameters in parameters.yml file, each parameter should have a different value based on logged in user’s role.

Is there is way to systematically decide and load correct value based on logged in user’s role?

Example:

parameters:
    user.address_code
    manager.address_code

Ideally, I don’t want to add conditions in my code for manager or user before I use address_code.

Source: Symfony Questions

Leave a Reply

Your email address will not be published. Required fields are marked *