Skip to content

Contradicting info about bundle resource loading #15419

Closed
@mmarton

Description

@mmarton

Hi!

in https://symfony.com/doc/current/bundles/best_practices.html#resources it sais that

If the bundle references any resources (config files, translation files, etc.), don’t use physical paths (e.g. __DIR__/config/services.xml) but logical paths (e.g. @AcmeBlogBundle/config/services.xml).
The logical paths are required because of the bundle overriding mechanism that lets you override any resource/file of any bundle. See Locating Resources for more details about transforming physical paths into logical paths.

And below that in the 'learn more' section there is a link to https://symfony.com/doc/current/bundles/extension.html
Which uses the old __DIR__/config at the https://symfony.com/doc/current/bundles/extension.html#using-the-load-method part.

I coudn't find any info about how to use the $kernel->locateResource() inside a bundle's load method and the ordinary Symfony\Component\Config\FileLocator cant handle logical paths.

Help me out please!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Keep openhasPRA Pull Request has already been submitted for this issue.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions