Z
Z
zizop2013-01-11 18:01:37
symfony
zizop, 2013-01-11 18:01:37

Access in yaml to array element (Symfony 2)?

Maybe someone came across. There is a bundle with parameters.yml
parameters.yml
-

parameters:<br>
    acme_default.options:<br>
        constants:<br>
            root_path: /home/www/acme.ru/web<br>
    acme_default.config_path: %acme_default.options.constants[root_path]%/cfg.ini<br>

This kind of thing doesn't work. Question: how can I get to the parameter (root_path) in the yml file, which lies in the array (constants)?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
Z
zizop, 2013-01-12
@zizop

Looked at the source. Parameters must be plain-value, i.e. stupidly key-value i.e. in php you can then get an array via getParameter(), and then its element, but not in the yaml file itself. Thank you.

V
Vyacheslav Slinko, 2013-01-11
@KeepYourMind

Format the code.

V
Vyacheslav Slinko, 2013-01-11
@KeepYourMind

%acme_default.options.constants.root_path%/cfg.ini?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question