I want to upload a simple image with twig.
Reading the symfony manual says that we put this in twig ...
<img src="{{ asset('images/logo.png') }}" alt="Symfony!" />
Well, it does not work.
I have installed assets, $ composer require asset
the logo.png file can be found in the assets / images /
folderI have also tried to create an addentry in the webpack.config.js file
like this:
.addEntry('logoBoard', './assets/images/logo.png')
but the file does not load.
The file that creates me in public / build / images is logo.ac628998.png, I think this is for the addEntry.
I managed to load it once like this:
<img src="{{ asset('build/images/logo.ac628998.png') }}" alt="Symfony!" />
But I guess this is not the correct way ...
Greetings and thanks.