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
;
JavaScript
x
# app/config/config.yml
parameters:
myVariable: 10
And you can use it;
JavaScript
$this->getParameter('myVariable');