cancel
Showing results for 
Search instead for 
Did you mean: 

how to add image on phtml file

SOLVED

how to add image on phtml file

hi 

 

how to add image path on phtml from /pub/media/myfolder/image.png ? 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: how to add image on phtml file

Hello wizardmadness,

 

Give a try with 

<img src="<?php echo $block->getUrl("pub/media/myfolder/")?>image.png"/>

 

There must be a better way but this one works Smiley Happy

 

Best

View solution in original post

2 REPLIES 2

Re: how to add image on phtml file

Hello wizardmadness,

 

Give a try with 

<img src="<?php echo $block->getUrl("pub/media/myfolder/")?>image.png"/>

 

There must be a better way but this one works Smiley Happy

 

Best

Re: how to add image on phtml file

How to get the media folder URL programmatically: https://mage2.pro/t/153