I have noticed that in the config.yml file of symfony2, the import feature is used as below
imports:
- { resource: security.yml }
- { resource: services.yml }
I am using some YAML file in my own bundle to init some read only entities. However, they are all jam-packed in this one single YAML file. I am using Symfony\Component\Yaml\Parser;
component to read this file.
However, if I try to copy this nice feature of import
, the parser only reads it normally and it doesn't interpret the import nor the resource keyword.
imports:
- { resource: test.yml }
That is the var_dump is simply the node tree without interpretation. Test is not loaded.
How can I use this same feature as in the config.yml file ?