Laravel重定向分類如下:
1、a鏈接跳轉(zhuǎn):
a class="btn btn-success" href="{{url('admin/organization/createAuthCodeView', ['id' => $list['id']])}}" rel="external nofollow" >生成注冊(cè)碼/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="請(qǐng)輸入用戶名或者郵箱或者電話" 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">新增機(jī)構(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)示例就是小編分享給大家的全部?jī)?nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持腳本之家。
您可能感興趣的文章:- laravel 表單驗(yàn)證實(shí)現(xiàn)多個(gè)字段組合后唯一
- Laravel 驗(yàn)證碼認(rèn)證學(xué)習(xí)記錄小結(jié)
- laravel 數(shù)據(jù)驗(yàn)證規(guī)則詳解
- Laravel實(shí)現(xiàn)登錄跳轉(zhuǎn)功能
- laravel 解決強(qiáng)制跳轉(zhuǎn) https的問題
- 解決Laravel使用驗(yàn)證時(shí)跳轉(zhuǎn)到首頁的問題