I need to use an yml config file parameter into another yml config file in Symfony 1.4, and I don’t know how to do this.
In app.yml I have defined parameters like “ldap ip” or “ldap domain”, and theese parameters are also used in LDAPauth.yml. For that reason, I want to unify it:
app.yml:
all:
ldap:
ip: XXX.XXX.XXX.XXX
domain: ou=XXXXXX, ou=......
LDAPAuth.yml:
adLDAP:
base_dn: ou=XXXXXX, ou=......
domain_controllers:
- XXX.XXX.XXX.XXX
I tried this in LDAPAut.yml, but doesn’t work:
LDAPAuth.yml:
adLDAP:
base_dn: %APP_LDAP_IP%
domain_controllers:
- %APP_LDAP_DOMAIN%
I would appreciate if anybody knows how to make this works.
Thanks!
You can execute PHP code inside a yml (yep crazy but so useful sometimes).
In your case, since data inside
app.ymlfile are accessible usingsfConfig::get, you can do:The
"\n"at the end is to write a line return to no break the yml syntax.