springboot怎么把数据传给前端:springboot 如何引入前端 bootstrap?
这种问题网上一搜一大堆,你可以具体找一篇文章试试,遇到问题可以针对相关问题去提问。springboot通过jar包方式引入bootstrap_个人文章 - SegmentFault 思否 这不是查查就
顺晟科技
2022-10-18 12:33:17
124
我刚刚得到这个错误,所有的尝试,而更新我的表数据。
<块引用>ErrorException:正在从空值
创建默认对象AdminController.php
public function update(Request $r, $post_id) {
$post = Post::find($post_id);
$post->post_title = $r->post_title;
$post->post_image = $r->post_image;
$post->post_details = $r->post_details;
$post->post_rating = $r->post_rating;
$post->id = $r->id;
$post->save();
return back();
}
Route::resource('post', AdminController::class);
<代码><;DIV类=";编辑后内容";>;<;表单操作=";{{route(' post.update ',$list->;post_ID)}}";方法=";后";>;@CSRF@method(' put ')<;输入类型=";隐藏";名称=";ID";value=";{{$list->;ID}}";>;<;输入类型=";隐藏";name=";发布_评级";value=";{{$list->;后_评级}}";>;<;DIV类=";MB-3";>;编辑标题:<;输入类=";表单控制";name=";发布_标题";类型=";文本";ID=";ExampleFormControlInput1";value=";{{$LIST->;发布_标题}}";aria-label=";默认输入示例";>;<;/DIV>;<;DIV类=";MB-3";>;编辑说明:<;文本区域类=";表单控制";ID=";ExampleFormControlTextArea1";name=";发布_详细信息";行=";3";>;{{$LIST->;发布_详细信息}}<;/文本区域>;<;/DIV>;<;细分(>;)<;IMG SRC=";{{asset(' images/'.trim($LIST->;发布_图像))}";alt=";";宽度=";120px;";>;编辑照片:<;输入ID=";FormFileMultiple";类=";表单控制表单控制-LG";name=";发布_图像";类型=";文件";value=";{{$LIST->;发布_图像}}";多个>;<;/DIV>;<;按钮类型=";提交";类=";btn btn-primary";>;保存更改<;/按钮>;<;/窗体>;<;/DIV>;有人
能帮帮我吗?
顺晟科技:
<div class="edit-post-content">
<form action="{{ route('post.update',$list->post_id) }}" method="POST">
@csrf
@method('PUT')
<input type="hidden" name="id" value="{{$list->id}}">
<input type="hidden" name="post_rating" value="{{$list->post_rating}}">
<div class="mb-3">
Edit Title: <input class="form-control" name="post_title" type="text" id="exampleFormControlInput1" value="{{$list->post_title}}" aria-label="default input example">
</div>
<div class="mb-3">
Edit Description:
<textarea class="form-control" id="exampleFormControlTextarea1" name="post_details" rows="3">
{{ $list->post_details }}
</textarea>
</div>
<div>
<img src="{{asset('images/'.trim($list->post_image))}}" alt="" width="120px;">
Edit Photos:
<input id="formFileMultiple" class="form-control form-control-lg" name="post_image" type="file" value="{{ $list->post_image }}" multiple>
</div>
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>
</div>
可能不存在。您可以在控制器中添加对此的检查,如下所示:
model
05
2022-12
02
2022-12
02
2022-12
29
2022-11
29
2022-11
24
2022-11