Haehnchen / idea-php-symfony2-plugin

IntelliJ IDEA / PhpStorm Symfony Plugin
https://plugins.jetbrains.com/plugin/7219
MIT License
910 stars 137 forks source link

AssetMapper: Support for assets-paths #2236

Closed Chris53897 closed 5 months ago

Chris53897 commented 11 months ago

Thanks for this great plugin.

It would be great if this plugin could support the AssetMapper feature to map the paths for the assets.

Example in a twig-file. {{ asset('apple-touch-icon.png') }}

The symfony default is, to search for assets in public/. With AssetMapper the assets are managed by default in assets/. https://symfony.com/doc/current/frontend/asset_mapper.html#framework-asset-mapper-paths

After i upgraded our projects to AssetMapper and move all the files from /public to /assets, the files could not be resolved and found anymore.

config/asset_mapper.yaml

framework:
    asset_mapper:
        # The paths to make available to the asset mapper.
        paths:
            - assets/

Proposal: Read the yaml-File and get the path mappings. Try to resolve and find assets with this mapping paths.

weaverryan commented 9 months ago

Yes, this would be fantastic! If there is some format in which the framework could expose the asset paths in a more systematic way to support the plugin, please let me know.

Thanks!