Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit magento.stackexchange
scroll top