Laravel Angular JS:语法错误,意外'>'

时间:2016-02-25 12:38:57

标签: php angularjs laravel

这是我的代码,它会出现这样的错误

" 40c069d0d4c87feb028bacb0d3340515第92行中的FatalErrorException  语法错误,意外'>' "

我该怎么办?请参阅下面的附件。感谢。

See the attachment

@extends('master')
@section('content')
<style>
    .table-condensed > tbody > tr > td {
        padding: 5px !important;
    }
    .daterangepicker_input input[type="text"]{
        padding: 0 6px 0 28px !important;
        min-height: 0 !important;
    }
    table td{border:none !important;}
</style>
<div class="row" ng-app="reportsApp" ng-controller="reportsController">

    <div class="col-md-12">
        <div class="span12">
            <div class="grid simple">
                <div class="grid-title noPrint">
                    <h4>Missing POs</h4>
                </div>
                <div class="grid-body">

                    {!! Form::open(['method'=>'POST', 'url'=>['report/missingPOs']]) !!}
                    <div class="form-row row col-md-12 noPrint">

                        <div class="col-md-5" style="padding: 0;">
                            <div class="col-md-12 input-append success form-group" style="padding: 0;">
                                <div class="col-md-5" style="float: left;">
                                    {!! Form::text('range',null, ['class'=>'form-control','style'=>'width:170px','id'=>'range']) !!}
                                    {!! Form::hidden('from', null,['id'=>'from']) !!}
                                    {!! Form::hidden('to', null,['id'=>'to']) !!}
                                    <span class="add-on">

>                                             <span class="arrow"></span>
>                                             <i class="fa fa-th"></i>
>                                         </span>
>                                     </div>
>                                     <div class="col-md-6" style="float: left;">
>                                         @if(isset($mpo['regions_id']))
>                                         {!! Form::select('regions_id',$regions,$mpo['regions_id']) !!}
>                                         @else
>                                         {!! Form::select('regions_id',$regions,null) !!}
>                                         @endif
>                                     </div>
>                                     <div class="col-md-1">
>                                         {!! Form::submit('Search',['class'=>'btn btn-success btn-cons']) !!}
>                                     </div>
>     
>                                 </div>
>                             </div>
>                         </div>
>                         {!! Form::close() !!}
>     
>                         <h4 class="semi-bold doPrint" >Missing POs</h4>
>                         @if(isset($mpo))
>                         <div>
>                             <h4>
>                                 Report period: {!! $mpo['from'] !!} to {!! $mpo['to'] !!}
>                             </h4>
>                             <h4>
>                                 Region: {!! $selectedRegion !!}
>                             </h4>
>                         </div>
>                         @endif
>                         <table class="table table-hover table-condensed" id="example">
>                             <thead>
>                                 <tr>
>                                     <th data-hide="phone,tablet" style="width:20%">Region</th>
>                                     <th style="width:10%" data-hide="phone,tablet">Brand</th>
>                                     <th style="width:10%">Store</th>
>                                     <th style="width:10%" data-hide="phone,tablet">Date</th>
>                                     <th style="width:10%" data-hide="phone,tablet">Shift Time</th>
>                                     <th style="width:10%" data-hide="phone,tablet">Consultant</th>
>                                 </tr>
>                             </thead>
>                             <tbody>
>                                 <?php
>                                 $cr = '';
>                                 ?>
>                                 @if (isset($results))
>                                 @foreach ($results as $key=>$r)
>                                 <tr style="<?php if ($cr != $r->regionName) echo "border-top:1px solid #ddd !important;" ?>">
>                                     <?php ?>
>                                     <td>{{$r - > regionName}}, {{$r - > regionSubName}}</td>
>                                     <td>{{$r - > brandName}}</td>
>                                     <td>{{$r - > storeName}}</td>
>                                     <td>{{$r - > sDate}}</td>
>                                     <td>{{$r - > sStart.'-'.$r - > sEnd}}</td>
>                                     <td>{{$r - > fName.' '.$r - > lName}}</td>
>                                     <?php
>                                     $cr = $r->regionName;
>                                     ?>
>                                 </tr>
>                                 @endforeach
>                                 @endif
>                             </tbody>
>                         </table>
>                     </div>
>                 </div>
>             </div>
>         </div>
>     </div>
>     
>     
>     @stop
>     
>     @section('content')
>     <script>
>                 $(function () {
>                 function cb(start, end) {
>                 $("#from").val(start.format('DD-MM-YYYY'))
>                         $("#to").val(end.format('DD-MM-YYYY'))
>                 }
>                 cb(<?php echo (isset($mpo['from'])) ? 'moment("' . $mpo['from'] . '", "DD-MM-YYYY")' : 'moment().subtract(7, "days")'
> ?>,<?php echo (isset($mpo['to'])) ? 'moment("' . $mpo['to'] . '",
> "DD-MM-YYYY")' : 'moment()' ?>);
>                         $('input[name="range"]').daterangepicker({
>                 locale: {
>                 format: 'DD-MM-YYYY'
>                 },
>                         startDate: <?php echo (isset($mpo['from'])) ? 'moment("' . $mpo['from'] . '", "DD-MM-YYYY")' : 'moment().subtract(7,
> "days")' ?>,
>                         endDate: <?php echo (isset($mpo['to'])) ? 'moment("' . $mpo['to'] . '", "DD-MM-YYYY")' : 'moment()' ?>
>                 }, cb)
>                 });
>     </script>

@append

1 个答案:

答案 0 :(得分:0)

您调用对象变量的方式是导致此错误的原因。

你正在调用像这样的对象的变量:

{{$r - > regionName}}

哪个应该是

{{$r->regionName}}

所以没有间距。进行这些更改可能会修复您的错误。

修改

我尝试更改代码,如果这适合您,请告诉我: http://pastie.org/10737121