Add Images in Magento Theme template file
-
05-10-2020 - |
Question
I want to add image like footer.png
in
app/design/frontend/vendorname/themename/Magento_Theme/templates/html/footer.phtml
Here I am adding image using
<img src='<?php echo $this->getViewFileUrl('Company_Module::images/image-icon.png'); ?>' alt="image-icon" width="30" height="25"
Image In Magento_Theme/web/images
folder
Solution
$this->getViewFileUrl('Company_Module::images/image-icon.png');
Your image should put under web
folder in your custom module: app/code/Company/Module/view/frontend/web/images/image-icon.png
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange