@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)];
?>
尝试将一些vanilla php代码插入到刀片视图中。我在<?php>
标记内添加了所有内容。获取语法错误:
ErrorException in 1ebcdcea94da98aea68c5115912d9e58eae221d3.php line 13:
Parse error: syntax error, unexpected '=' (View: /var/www/html/cs3226/resources/views/index.blade.php)
为什么呢?无法看到任何语法错误。
答案 0 :(得分:1)
我认为你应该更新你的代码:
$.getJSON('/bin/reference/data/device/availablecolour.availablecolour.json$PATH?selectedDevice=' + selected + '&colour=red'
希望这对你有用!