How Can I define global CONST variables in my app symfony ? What are the good practices define global variables in symfony? Mayby Should I create interface and use DI ?
Advertisement
Answer
You should add your variables into app/config/config.yml
;
# app/config/config.yml parameters: myVariable: 10
And you can use it;
$this->getParameter('myVariable');