课程/PHP/后端开发
轻松学会Laravel-表单篇
-
-
Heracles
2022-04-16
Laravel表单修改


-
0赞 · 0采集
-
-
月3070044
2020-07-20
- isset()报错sex字段问题
解决方案:把模型里边sex函数改个名字即可,不然会误引用sex()函数,而不是$student的sex属性
-
截图
0赞 · 0采集
-
-
technoart
2019-01-06
更新数据代码
-
截图
0赞 · 0采集
-
-
technoart
2019-01-06
控制器里调用
-
截图
0赞 · 0采集
-
-
technoart
2019-01-06
修改页面代码
-
截图
0赞 · 0采集
-
-
technoart
2019-01-06
修改页面代码
-
截图
0赞 · 0采集
-
-
technoart
2019-01-06
路由配置信息
-
截图
0赞 · 0采集
-
-
technoart
2019-01-06
添加修改链接
-
截图
0赞 · 0采集
-
-
龙峰
2018-12-01
更新数据相应的逻辑
-
截图
0赞 · 0采集
-
-
龙峰
2018-12-01
radio类型的界面处理
-
截图
0赞 · 0采集
-
-
南京烧饼
2018-03-18
- 报错:Call to a member function format() on string
解决方法:
在model里加上
public function freshTimestamp() {
return time();
}
public function fromDateTime($value) {
return $value;
}
protected function asDateTime($val){
return $val;
}
-
0赞 · 1采集
-
-
zhaiduting
2018-03-11
- “修改”按钮的链接
{{ url('sutdent/update',['id'=>$student->id)] }}
可以简化成
{{ url('sutdent/update',$student->id) }}
两者等效
-
截图
1赞 · 1采集
-
-
慕用5167111
2017-11-09
- 其实不单单是sex会出现报错 name框和age框也会出现报错 因为当创建的时候没有student的值而他要使用该值则会报错 解决方法:
{{old('name') ? old('name') : (isset($student->name) ? $student->name : '') }}
写两个三元运算符 当他的否则没有的话则判断student是否存在 如果存在则使用 否则则使用空字符串 这样就不会报错了 不懂私信我
-
0赞 · 0采集