Magento 2 - How to load image from theme in frontend?
سؤال
I uploaded the image amazon-pay-ic.svg to THEME/web/images/.
How can I load it in the frontend?
I tried www.example.com/images/amazon-pay-ic.svg
but it does not work and shows the 404 site.
المحلول
<img src="{{view url="images/amazon-pay-ic.svg"}}" alt="test" />
inside PHTML templates, then flush full_page and block_html caches.
For HTML templates use this:
<img data-bind="attr: { src: require.toUrl('images/amazon-pay-ic.svg') }" alt="test" />
لا تنتمي إلى magento.stackexchange