5

... in my phtml view

I want to add a image in my view.

Somebody know how to do it ?

Thanks for help..

closed as unclear what you're asking by 7ochem, Khoa TruongDinh, Murtuza Zabuawala, Amit Bera, Qaisar Satti Feb 9 '17 at 4:43

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

10

I hope you ask how to show image in phtml

If you call image from theme

<img src="<?php echo $this->getViewFileUrl('img/image.jpg'); ?>" />

image location should be

app/design/frontend/Vendor/theme/web/img/image.jpg


If you call image from module

<img src="<?php echo $this->getViewFileUrl('Vendor_Module::img/image.jpg'); ?>" />

image location should be

app/code/Vendor/Module/view/frontend/web/img/image.jpg

  • yup that is the default path for static file like js,css,image. If you set developer mode it will generate automatically from module and theme by symlink. If you felt any issue in static file generation follow this answer magento.stackexchange.com/a/94506/36463 – Bilal Usean Feb 8 '17 at 14:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.