jeudi 20 juillet 2017

How to write html code with blade commands in laravel?

I am working on laravel project for the first time and i am stuck here with display table. I just copy and paste one code from google.

    @extends('layout/template')
    @section('content')
     <h1>Peru BookStore</h1>
     <a href="" class="btn btn-success">Create Book</a>
     <hr>
     <table class="table table-striped table-bordered table-hover">
         <thead>
         <tr class="bg-info">
             <th>Id</th>
             <th>ISBN</th>
             <th>Title</th>
             <th>Author</th>
             <th>Publisher</th>
             <th>Thumbs</th>
             <th colspan="3">Actions</th>
         </tr>
         </thead>
         <tbody>
              @foreach ($books as $book)
             <tr>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td></td>
                 <td><img src="" height="35" width="30"></td>
                 <td><a href="" class="btn btn-primary">Read</a></td>
                 <td><a href="" class="btn btn-warning">Update</a></td>
                 <td>
                    {!! Form::open(['method' => 'DELETE', 'route'=>['books.destroy', $book->id]]) !!}    
                 {!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}
                     {!! Form::close() !!}
                 </td>
             </tr>
         @endforeach 

     </tbody>

 </table>
@endsection

I am using this code and problem is my blade commands are visible in webpage. I hear that there is no need to use php tags if i am using blade.php. whats wrong with my code please help me with the same.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2vpS6ow
via IFTTT

Aucun commentaire:

Enregistrer un commentaire