2-7使用了isset之后create頁(yè)面仍報(bào)錯(cuò)
ErrorException?in?Model.php line 2697:Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relation (View: /home/ubuntu/workspace/resources/views/student/_form.blade.php) (View: /home/ubuntu/workspace/resources/views/student/_form.blade.php)
?????????????????????????????????????????@foreach($student->sex() as $ind=>$val)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <label class="radio-inline">
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <input type="radio" name="Student[sex]"?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {{ isset($student->sex) && $student->sex == $ind ? 'checked' : '' }}?
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? value="{{ $ind }}">{{ $val }}
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? </label>
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? @endforeach
修改頁(yè)面可以使用,但是create加了isset之后仍然報(bào)錯(cuò)
2016-12-13
將sex()改成別的方法比如sexList()
2016-12-13
這個(gè)可以通過(guò)在model中添加一個(gè)默認(rèn)的屬性
2016-12-06
我用了isset就沒(méi)有報(bào)錯(cuò)了