这是我的函数
public function check()
{
$data = [
'pageTitle' => 'Documents Check',
'action' => 'check',
'validation' => NULL,
];
if($this->request->getMethod() == 'post'){
$validation = $this->validate([
'jobNo' => [
'rules' => 'required|numeric|exact_length[6]|is_not_unique[docs.Job_no]',
'errors' => [
'required' => 'Job No. required.',
'exact_length' => 'Job No. should be exactly 6 digits.',
'numeric' => 'Job No. should be numbers only.',
'is_not_unique' => 'No files available for entered Job No.',
]
],
]);
if($validation){
$jobNo = $this->request->getVar('jobNo',FILTER_SANITIZE_STRING);
$data['docs'] = $this->docsModel->getDocsByJob($jobNo);
return view('documents/files_display',$data);
}
else{
$data['validation'] = $this->validator;
}
} // post
return view('documents/files_view',$data);
} // check
文件_显示外观
| 标识符|工单号|文件|作用|
| - -|- -|- -|- -|
| 一个|小行星23233| invoice.pdf |除去了|
| 2个|小行星23233| deliver.pdf |除去了|
public function remove($id){
if($this->docsModel->delete($id);){
return redirect()->back()->with('success','file removed from the Job record');
}
}
所以在这里redirect()-〉back()或current_url()把我带到页面,在那里我必须再次输入“工作号”的形式.我所寻找的是留在file_display页面上点击删除.
1条答案
按热度按时间qyuhtwio1#
也许可以使用Session