課程
/后端開發(fā)
/PHP
/輕松學(xué)會(huì)Laravel-表單篇
代碼和老師的一樣
2017-12-09
源自:輕松學(xué)會(huì)Laravel-表單篇 2-4
正在回答
已解決 沒事了
陳柴
為什么啊
$data= $request ->input('Student'); var_dump($data);
這樣寫的時(shí)候沒問題但是
$data= $request ->input('Student');$student=new Student();$student->name=$data('name');$student->age=$data('age');$student->sex=$data('sex');if ($student->save()){ ? ?return redirect('student/index');} else{ ? ?return redirect()->back();}
成了這樣后就報(bào)
Function name must be a string錯(cuò)誤了
應(yīng)該是表單令牌錯(cuò)誤,在表單中添加
<input type="hidden" name="_token" value="{{csrf_token()}}"/>
9420
你把代碼貼出來啊。貼個(gè)錯(cuò)誤誰知道
舉報(bào)
Laravel框架是世界上最流行的PHP框架,沒有之一
1 回答點(diǎn)擊新增學(xué)生報(bào)錯(cuò)
2 回答新增create提交后報(bào)419錯(cuò)誤,請(qǐng)問
1 回答求解答(新增頁(yè)面有問題)
3 回答為什么新增的數(shù)據(jù)時(shí)間還是默認(rèn)的
3 回答為什么新增數(shù)據(jù)的created_at沒有自動(dòng)維護(hù)
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2018-03-12
已解決 沒事了
2018-03-12
為什么啊
2018-03-12
$data= $request ->input('Student');
var_dump($data);
這樣寫的時(shí)候沒問題但是
$data= $request ->input('Student');
$student=new Student();
$student->name=$data('name');
$student->age=$data('age');
$student->sex=$data('sex');
if ($student->save()){
? ?return redirect('student/index');
} else{
? ?return redirect()->back();
}
成了這樣后就報(bào)
Function name must be a string錯(cuò)誤了
2017-12-13
應(yīng)該是表單令牌錯(cuò)誤,在表單中添加
<input type="hidden" name="_token" value="{{csrf_token()}}"/>
2017-12-12
你把代碼貼出來啊。貼個(gè)錯(cuò)誤誰知道