如何在laravel 5的索引视图页面中显示图像?

时间:2015-12-29 12:29:53

标签: laravel-5

index.blade.php

我正在使用img src =" {{URL :: asset($ task-> image)}}"显示图像,但它不工作...请建议我如何实现它.. 任何帮助???

@extends ('welcome')

@section ('content')
<h1 class="headng"> Form List </h1>
    <table class="table  table-hover ">
        <tr>
            <th><h4>Title</h4></th>
            <th><h4>Description</h4></th>
            <th><h4>Image</h4></th>
            <th><h4>Printable</h4></th>
            <th><h4>Actions</h4></th>
        </tr>
        @foreach($tasks as $task)
        <tr>
            <td>{{ $task->title }}</td>
            <td>{{ $task->description }}</td>
            <td><img src="{{ URL::asset($task->image) }}" /></td>
            <td>{{ $task->printable }}</td>
            <td>
                <a href = '{{ action('TasksController@edit',[$task->id]) }}'>Edit</a> |
                {!! Form::open([
       'method' => 'DELETE',
       'route' => ['tasks.destroy', $task->id]
   ]) !!}
                {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}
                {!! Form::close() !!}
            </td>
        </tr>
        @endforeach
    </table>
@stop

0 个答案:

没有答案