Laravel重定向,a鏈接跳轉(zhuǎn),控制器跳轉(zhuǎn)示例
更新時間:2019年10月22日 10:01:12 作者:SHUIPING_YANG
今天小編就為大家分享一篇Laravel重定向,a鏈接跳轉(zhuǎn),控制器跳轉(zhuǎn)示例,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
Laravel重定向分類如下:
1、a鏈接跳轉(zhuǎn):
<a class="btn btn-success" href="{{url('admin/organization/createAuthCodeView', ['id' => $list['id']])}}" rel="external nofollow" >生成注冊碼</a>
2、form表單提交跳轉(zhuǎn):
<form class="form-inline" method="get" action="{{ url('admin/organization/listOrganization') }}">
<div class="form-group" style="margin-left: 20px">
<input type="hidden" name="customer_type" value="1">
<label for="perPage">每頁顯示數(shù):</label>
<select class="form-control" id="perPage" name="perPage">
@foreach ( [10,20,30,50] as $e)
<option value="{{$e}}" {{ $e==request('perPage') ? 'selected' : '' }} >{{$e}}</option>
@endforeach
</select>
</div>
<div class="form-group" style="margin-left: 20px">
<label for="search">模糊搜索:</label>
<input type="text" name="search" style="width: 400px" class="form-control" id="search" placeholder="請輸入用戶名或者郵箱或者電話" value="{{request('search')}}">
</div>
<button type="submit" class="btn btn-primary" style="margin-left: 20px">開始搜索</button>
<a href="{{url('admin/organization/createOrganization')}}" rel="external nofollow" class="pull-right">
<button class="btn btn-primary">新增機構(gòu)</button>
</a>
</form>
3、ajax提交跳轉(zhuǎn):
<script type="text/javascript">
$(function(){
$.ajaxSetup({
headers: { 'X-CSRF-TOKEN' : '{{ csrf_token() }}' }
});
$("#generate").click(function(){
$.ajax({
url:"/admin/organization/generateAuthCode", //你的路由地址
type:"post",
data:{"auth_num":$('#auth_num').val(),"organization_name":$('#organization_name').val()},
timeout:30000,
success:function(data){
$("#auth_codes").val(data);
},
error:function(){
console.log(data);
}
});
});
})
</script>
4、控制器方法里面跳轉(zhuǎn):
return redirect('/admin/organization/listOrganization');
以上這篇Laravel重定向,a鏈接跳轉(zhuǎn),控制器跳轉(zhuǎn)示例就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關(guān)文章
PHP使用Apache的偽靜態(tài)功能實現(xiàn)“網(wǎng)頁404時跳轉(zhuǎn)指定頁面
這篇文章主要介紹了PHP使用Apache的偽靜態(tài)功能實現(xiàn)“網(wǎng)頁404時跳轉(zhuǎn)指定頁面,這是比較常見的頁面,文中的方法可以很好的解決,有需要的同學(xué)可以借鑒下2021-03-03
laravel-admin 添加、編輯按鈕支持攜帶參數(shù)的解決方法
通過修改源碼實現(xiàn)laravel-admin添加、編輯按鈕支持攜帶參數(shù),解決一些特殊功能需求,并且不影響之前添加和編輯程序運行,本文通過實例代碼給大家介紹的非常詳細,需要的朋友參考下吧2023-11-11
詳解Laravel設(shè)置多態(tài)關(guān)系模型別名的方式
這篇文章主要介紹了Laravel 中簡單設(shè)置多態(tài)關(guān)系模型別名的方式,需要的朋友可以參考下2019-10-10
destoon調(diào)用discuz論壇中帶圖片帖子的實現(xiàn)方法
這篇文章主要介紹了destoon調(diào)用discuz論壇中帶圖片帖子的實現(xiàn)方法,是destoon開發(fā)中非常實用的一個技巧,需要的朋友可以參考下2014-08-08

