2016-03-07 157 views
1

我有一个<img>标记存储在MySQL数据库中,我想要在Laravel 5.1中查看我的视图。事情是我把它作为一个<img>标签,而不是图像本身。laravel 5.1图像显示不正确

视图代码:

@foreach ($get_followee_posts as $post) 
<form action="/html/tags/html_form_tag_action.cfm" method="post"> 
<textarea name="post_section" id="post_section" style="width:96%;height:90px;background-color:white;color:black;border:none;padding:2%;font:22px/30px sans-serif;"> 
{!! $post->full_post !!} </textarea> 
</textarea> 
</form> 
@endforeach 

控制器代码:

$get_followee_posts= Post::whereIn('user_id',$followingNow->lists('id'))->get(); 

这里的数据库记录的〔实施例后的权利(例如):

1st post!<img alt="heart" src="http://icons.iconarchive.com/icons/succodesign/love-is-in-the-web/512/heart-icon.png"> 

下面是截图问题:(心脏图标显示右侧太大,左侧好(插入帖子前)它返回<img>标签而不是图像)。

我也是这个foreach的用户summernote。如果你有更好的选择 - 我想听听那个。

谢谢。

+0

你试图在textarea内渲染你的图像?此外,你的屏幕截图缺失。 – PeterPan666

+0

这与MySQL或Sass有什么关系?什么是编译输出? – cimmanon

+0

是的我试图呈现textarea内的图像(作为一个职位的一部分)。 屏幕截图: http://1.1m.yt/k5Fy6By.png 我使用mysql作为我的数据库。并且我错误地添加了sass。这基本上是因为我需要调整渲染图像的尺寸 - 但我会在稍后处理它。 – osherdo

回答

-1

最终我设法解决了这个问题。

为图标创建了一个div,并将它们的大小调整为24x24。

<div class="followee_posts"> 

@foreach ($get_followee_posts as $post) 

{!! $post->full_post !!} <br><br> 

@endforeach 

.scss文件(followee_posts是相关的):

.test img, .icons img , .followee_posts img { 
    width: 24px; 
    height: 24px; 
} 

截图:

http://1.1m.yt/fuWvbts.png

感谢谁试图帮助。