【发布时间】:2017-06-29 19:56:45
【问题描述】:
@extends('template') <!-- use template from previous slide -->
@section('title')
Home
@endsection
@section('main') <!-- define a section called main -->
<?php
$sums = [];
$i = 0;
foreach($student as $s) {
$sum = $s->mc+$s->tc+$s->hw+$s->bs+$s->ks+$s->ac;
$sums[i] = $sum;
i = i+1;
}
$sums.arsort();
echo $sums[count($sums)];
?>
试图在刀片视图中插入一些普通的 php 代码。我在<?php> 标签中添加了所有内容。出现语法错误:
ErrorException in 1ebcdcea94da98aea68c5115912d9e58eae221d3.php line 13:
Parse error: syntax error, unexpected '=' (View: /var/www/html/cs3226/resources/views/index.blade.php)
为什么?看不到任何语法错误。
【问题讨论】: