Assets
To use assets in your Plugin, either for the storefront or the administration you will need to put them into the following directory:
- src
- Resources
- public
- assets
- Your image or document
- assets
- public
- Resources
After that you will need to install the assets manually via
php bin/console assets:install OR ./psh.phar administration:build
To use the assets in the storefront, you can access them by using the asset() Twig function:
{{ asset(bundles/<plugin name in lowercase>/assets/<assetname>.<file ending>) }}
So, for example:
<img src="{{ asset('bundles/econsorassetplugin/assets/image.png', 'asset')}}">
For the Administration you need to use the |asset filter:
<img :src='/<pluginname in lowercase>/<optional DIR>/<assetname>.<file ending> | asset“>