symfony - How to use a global config value in a private config file with symfony2 -


i defined values in define.yml in app/config folder.
, can access in php code.
want use validate.yml file check weather users give out many data, use configed valus in config file(such %maxinputlength%) rather write 1 more time in validate.yml?

for example: defind variable in define.yml:
maxlength: 10
can use in controller.

but if want use in validate.yml in own bundle, such : mybandle/config/validation.yml
use file that:

 mybundle\entity\userdesc:       properties:           content:               - notblank: ~               - maxlength: 10 

so seems same value defined @ 2 place.in fact 10 in second file value defined in first file . don't know how value first file.is there way make that?

afaik want set value variable in 1 config file , reuse in other .yml config file.

so cant define vars in e.g variables.yml file

parameters:     test_variable: "blabla" 

then in second .yml config file can import file defined variables:

imports:     - { resource: variables.yml } 

then can use imported variable in file:

property:     some_value: %test_variable% 

Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -