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