我只是想从流明中删除一条记录。
我的html视图按钮:
<li><a href="{!!url('delete-list'. $value->page_id) !!}"class="dangrclr"><i class="fa fa-trash-o"></i>Delete</a></li>
我的控制器:
public function deleteList($page_id)
{
$list= DB::table('page_master')->where('page_id',$page_id);
$list->delete();
return Redirect::to('page-list');
}
和我的routes.php文件看起来像:
$router->get('delete-list/{id}', 'AjaxController@deleteList');
当我点击删除按钮时,它会显示我
Sorry, the page you are looking for could not be found.
NotFoundHttpException
和我点击删除按钮时显示的网址是:
http://localhost:8000/delete-list3
我做错了什么?
答案 0 :(得分:0)
将此更改为
S= '13:18:52.196339'
A = [int(i) for i in S.replace('.', ':').split(':')]
此
<a href="{!!url('delete-list'. $value->page_id) !!}"
现在的网址 - <a href="{{ url('delete-list/'.$value->page_id) }}"
应为http://localhost:8000/delete-list3
您也可以使用route()
http://localhost:8000/delete-list/3
答案 1 :(得分:0)
您忘记在代码中使用/
。它应该是url('delete-list/'. $value->page_id)