0

I'm aware of using custom configuration values for my custom services, but what if I have global configuration values that I wish to use everywhere? A define would save my ass, but I'm sure the DI container has a more elegant approach.

I need a few global keys, so, how do define them in Symfony 2?

1

2 Answers 2

1

Define them in parameters.ini, and then you can do $container->getParameter('blah');

Sign up to request clarification or add additional context in comments.

Comments

0

I think you are looking for the container. This page shows how to define services, but you can do the same with parameters.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.