8000 Allow imports in string format for YAML · Issue #8159 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

Allow imports in string format for YAML #8159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
javiereguiluz opened this issue Jul 16, 2017 · 1 comment
Closed

Allow imports in string format for YAML #8159

javiereguiluz opened this issue Jul 16, 2017 · 1 comment

Comments

@javiereguiluz
Copy link
Member

Before

imports:
    - { resource: config.yml }

After

imports:
    - config.yml

Now the important question: should we update our examples? Should we use both formats? Only one of them? Which one? etc.


Personal comment: as I explained in symfony/symfony#23522 (comment) I think these changes create a lot of problems. Unless the new solution is 10 times better than the old solution, I don't think we should add alternative solutions to solve features.

@javiereguiluz
Copy link
Member Author

I'm closing this as "won't fix". I know it looks counterintuitive, but documenting this DX simplification would complicate things a lot in the docs.

If we use the new way of defining imports, we then need to explain the alternative way ({ resource: ... }) everywhere else...

... when you need to define the type of the loaded file:

imports:
        - { resource: parameters.res, type: yml }

... when you use the nice ignore_errors option:

imports:
    - { resource: 'parameters.yml' }
    - { resource: '/etc/sites/mysite.com/parameters.yml', ignore_errors: true }

... in other parts of the framework that require adding resource: and won't work otherwise:

framework:
   # ...
   router:          { resource: '%kernel.project_dir%/app/config/routing.yml' }

Moreover, we don't have so many occurrences of imports in the docs, so it's not a big deal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant
0