如何在Laravel 5.3中显示图像 [英] How display image in laravel 5.3
本文介绍了如何在Laravel 5.3中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我将图像存储在公用文件夹中,现在我想显示我提供的路径图像,但是图像未显示任何图像,这可以帮助我我的代码出了什么问题
I store image in public folder now i want to display the image i give the path but image not show any one help me whats the wrong in my code
我的图片完整路径为public/admin/product
My image complete path is public/admin/product
<img src="public/admin/product/<?php echo $productr['image']; ?>" height="30px" width="30px">
推荐答案
Laravel视图文件blade.php支持{{}}
标签来显示值.
Laravel view files blade.php supports {{}}
tags to display values.
{{ $valueToBeDisplayed }}
根据您的情况,您可以喜欢
In your case, you can do like
<img src="/admin/product/{{ $product['image'] }}" height="30px" width="30px" />
假设图片名称为abc.png.
Assuming image name is abc.png.
确保该图片位于文件夹public/admin/product/abc.png中
Make sure you have that image in folder public/admin/product/abc.png
这篇关于如何在Laravel 5.3中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文