Skip to content

file:// is not a valid url for asset embedding #28238

@alexander-schranz

Description

@alexander-schranz

Symfony version(s) affected: 3.4.12 (think currently all published symfony versions affected)

Description

I want to use file:// as base_urls in the framework asset configuration as this is a lot faster when generating pdfs from html.

How to reproduce

config.yml:

framework:
    assets:
        packages:
            pdf:
                base_urls: 'file://%kernel.project_dir%/web'

Twig:

{{ asset('test.jpg', 'pdf') }}

Ends up in:

(1/3) InvalidArgumentException"file:///Users/alex/development/symfony.lo/web" is not a valid URL

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions