2015-11-26 62 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

太好了,你会接受答案,关闭这个问题 –

相关问题