Laravel 5.1查看代码导致语法错误,意外'')); ?>“'('T_CONSTANT_ENCAPSED_STRING)

时间:2015-11-26 02:53:08

标签: php view laravel-5 laravel-blade

我有这个警告:

  哎呀,好像出了什么问题   1/1
  f042f5969df1fc17d22527840a4806ba第59行中的FatalErrorException:
  语法错误,意外'')); ?>“中
  '(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`

2 个答案:

答案 0 :(得分:0)

尝试删除此seqNext <- function(sequ, next) { .. } seqNext( c(3,7,13,21), 3) # 31 43 57 seqNext( c(37,26,17,10), 1) # 5 末尾的引用,使其看起来像{{ URL('/blog/'.$post->slug')}}

答案 1 :(得分:0)

这是你的错误

var myDate="01/01/2015";
var d = new Date(myDate);
alert(d.getDate() + '/' + (d.getMonth()+1) + '/' + d.getFullYear());

slug后的单引号。