2015-11-26 64 views
-3

我有這樣的警告:Laravel 5.1查看代碼導致語法錯誤,意外的'')); ?>」'(T_CONSTANT_ENCAPSED_STRING)

哎呦,看起來像出事了
1/1
FatalErrorException在f042f5969df1fc17d22527840a4806ba 59行:
語法錯誤,意外 '') );?>」
'(T_CONSTANT_ENCAPSED_STRING)
在f042f5969df1fc17d22527840a4806ba線59

我已經試圖找到問題,但仍然無法找到它。這是我的index.blade.php

<div class="container-fluid"> 
`@extends('admin.layout')` 
`@section('content')` 
    <div class="row page-title-row"> 
     <div class="col-md-6"> 
     <h3>Posts <small>» Listing</small></h3> 
     </div> 
     <div class="col-md-6 text-right"> 
     <a href="{{ URL('/admin/post/create')}}" class="btn btn-success btn-md"> 
      <i class="fa fa-plus-circle"></i> New Post 
     </a> 
     </div> 
    </div> 

    <div class="row"> 
     <div class="col-sm-12"> 

     `@include('admin.partials.errors')` 
     `@include('admin.partials.success')` 

     <table id="posts-table" class="table table-striped table-bordered"> 
      <thead> 
      <tr> 
       <th>Published</th> 
       <th>Title</th> 
       <th>Subtitle</th> 
       <th data-sortable="false">Actions</th> 
      </tr> 
      </thead> 
      <tbody> 
      @foreach ($posts as $post) 
       <tr> 
       <td data-order="{{ $post->published_at->timestamp }}"> 
        {!! $post->published_at->format('j-M-y g:ia') !!} 
       </td> 
       <td>{!! $post->title !!}</td> 
       <td>{!! $post->subtitle !!}</td> 
       <td> 
        <a href="{{ URL('/admin/post/'.$post->id.'/edit')}}" 
        class="btn btn-xs btn-info"> 
        <i class="fa fa-edit"></i> Edit 
        </a> 
        <a href="{{ URL('/blog/'.$post->slug')}}" 
        class="btn btn-xs btn-warning"> 
        <i class="fa fa-eye"></i> View 
        </a> 
       </td> 
       </tr> 
      @endforeach 
      </tbody> 
     </table> 
     </div> 
    </div> 
    </div> 
`@stop` 

-------------------------------------------------------------line 59 


          
  
`@section('scripts')`  
 
<script> 
 
     $(function() { 
 
      $("#posts-table").DataTable({ 
 
      order: [[0, "desc"]] 
 
      }); 
 
     }); 
 
     </script> 
 
`@stop`
+0

上面提到的文件的第59行是什麼,可以在storage/framework/views文件夾下找到 –

回答

0

代碼嘗試在這個{{ URL('/blog/'.$post->slug')}}結束除去報價因此它看起來就像{{ URL('/blog/'.$post->slug)}}

+0

我已經刪除了單引號,但它仍然不起作用 – Tika

+0

嘗試刪除此引號末尾的引號, URL('/ blog /'。$ post-> slug')}}'看起來像{{URL('/ blog /'.$ post-> slug)}}' – Pistachio

+0

這就是問題所在! 謝謝。它現在有效。 – Tika

0

這是在這裏你的錯誤

"{{ URL('/blog/'.$post->slug')}}" 

單引號塞後。

+0

是的,我的不好。 謝謝 – Tika

+0

太好了,你會接受答案,關閉這個問題 –

相關問題