Question

Image path -> app/design/frontend/Mycustom/Mytheme/web/image/one.png how to get image in PHTML (app/design/frontend/Mycustom/Mytheme/Magento_Search/templates/form.mini.phtml) file,

<?php  echo __('Search');?>

I need to show image instead of text Search, any help thanks.

Était-ce utile?

La solution

You can call static images in phtml by:

<img src='<?php echo $this->getViewFileUrl('images/my-logo.png'); ?>' alt="Logo">

Img Path:

app/design/frontend/{Package}/{theme}/web/images/my-logo.png

Ref: link

Licencié sous: CC-BY-SA avec attribution
Non affilié à magento.stackexchange
scroll top