當前位置: 首頁>>代碼示例>>PHP>>正文


PHP redirect::action方法代碼示例

本文整理匯總了PHP中redirect::action方法的典型用法代碼示例。如果您正苦於以下問題:PHP redirect::action方法的具體用法?PHP redirect::action怎麽用?PHP redirect::action使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在redirect的用法示例。


在下文中一共展示了redirect::action方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handle

 public function handle($request, Clousure $next)
 {
     if (!userAuth::check()) {
         return redirect::action('topm_ctl_passport@signin');
     }
     return $next($request);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:7,代碼來源:authenticate.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(CreateBookRequest $request)
 {
     $user = \Auth::User();
     if (!$user) {
         return view('auth.login')->withErrors('You are not loged in, please loged in !');
     }
     $book = $request->bookFillData();
     $book['user_id'] = $user->id;
     $book['published_at'] = Carbon::parse($request->get('published_at'))->format('Y-m-d');
     $fileSizeValidation = \Config::get('library.image_file_size');
     $newBook = Book::create($book);
     $newBook->syncAuthors($request->get('authors'));
     $this->manager->createDirectory($newBook->id);
     $file = $_FILES['image'];
     if ($file['size'] > 0) {
         // Additional image validation
         if (!starts_with($file['type'], 'image/')) {
             return Redirect::action('BookController@create')->withErrors('Invalid file format, please use image !');
         }
         $fileSize = $file['size'] / 1024;
         if ($fileSize > $fileSizeValidation) {
             return Redirect::action('BookController@create')->withErrors('The image may not be greater than ' . $fileSizeValidation . ' kilobytes. ');
         }
         $img = Image::make($_FILES['image']['tmp_name']);
         $img->resize(140, 140);
         $img->save('.' . \Config::get('library.uploads.webpath') . DIRECTORY_SEPARATOR . $newBook->id . '/cover.jpg');
     }
     return redirect::action('BookController@index')->withSuccess("The book with title '{$newBook->title}' was created.");
 }
開發者ID:EmilAleksandrov,項目名稱:book-library-laravel,代碼行數:35,代碼來源:BookController.php

示例3: applyForOpen

 public function applyForOpen()
 {
     $shopId = $this->shopId;
     $requestParams = ['shop_id' => $shopId];
     $res = app::get('topshop')->rpcCall('open.shop.develop.apply', $requestParams);
     redirect::action('topshop_ctl_open@index')->send();
     exit;
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:8,代碼來源:open.php

示例4: __construct

 public function __construct(&$app)
 {
     parent::__construct();
     // 檢測是否登錄
     if (!userAuth::check()) {
         redirect::action('topc_ctl_passport@signin')->send();
         exit;
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:9,代碼來源:cart.php

示例5: __construct

 public function __construct(&$app)
 {
     parent::__construct();
     // 檢測是否登錄
     if (!userAuth::check()) {
         redirect::action('topm_ctl_passport@signin')->send();
         exit;
     }
     $this->setLayoutFlag('cart');
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:10,代碼來源:cart.php

示例6: goAftersalesDetail

 public function goAftersalesDetail()
 {
     $params['oid'] = input::get('id');
     $params['fields'] = 'aftersales_bn';
     $result = app::get('topm')->rpcCall('aftersales.get.bn', $params);
     if (is_null($result)) {
         redirect::action('topm_ctl_member_trade@tradeList')->send();
         exit;
     }
     redirect::action('topm_ctl_member_aftersales@aftersalesDetail', array('id' => $result['aftersales_bn']))->send();
     exit;
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:12,代碼來源:aftersales.php

示例7: handle

 public function handle($request, Clousure $next)
 {
     //獲取shopInfo
     $sellerId = pamAccount::getAccountId();
     $shopId = app::get('topshop')->rpcCall('shop.get.loginId', array('seller_id' => $sellerId), 'seller');
     $requestParams = ['shop_id' => $shopId];
     $shopConf = app::get('topshop')->rpcCall('open.shop.develop.conf', $requestParams);
     if ($shopConf['develop_mode'] == 'DEVELOP') {
         return redirect::action('topshop_ctl_index@nopermission');
     }
     return $next($request);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:12,代碼來源:developerMode.php

示例8: handle

 public function handle($request, Clousure $next)
 {
     //獲取shopInfo
     $sellerId = pamAccount::getAccountId();
     $shopId = app::get('topshop')->rpcCall('shop.get.loginId', array('seller_id' => $sellerId), 'seller');
     //獲取商鋪信息
     $requestParams = ['shop_id' => $shopId, 'fields' => 'shop_id,shop_name,shop_type'];
     $shopInfo = app::get('topshop')->rpcCall('shop.get', $requestParams);
     if ($shopInfo['shop_type'] != 'self') {
         return redirect::action('topshop_ctl_index@onlySelfManagement');
     }
     return $next($request);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:13,代碼來源:selfManagement.php

示例9: __construct

 public function __construct(&$app)
 {
     parent::__construct();
     theme::setNoindex();
     theme::setNoarchive();
     theme::setNofolow();
     theme::prependHeaders('<meta name="robots" content="noindex,noarchive,nofollow" />\\n');
     $this->title = app::get('topm')->_('訂單中心');
     // 檢測是否登錄
     if (!userAuth::check()) {
         redirect::action('topm_ctl_passport@signin')->send();
         exit;
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:14,代碼來源:trade.php

示例10: index

 public function index()
 {
     $keyword = input::get('keyword');
     $searchType = input::get('searchtype');
     if (!empty($keyword)) {
         if ($searchType == 'shop') {
             return redirect::action('topc_ctl_shopcenter@search', array('n' => $keyword));
         } else {
             return redirect::action('topc_ctl_list@index', array('n' => $keyword));
         }
     } else {
         return redirect::back();
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:14,代碼來源:search.php

示例11: detail

 public function detail()
 {
     $params['aftersales_bn'] = input::get('bn');
     $params['shop_id'] = $this->shopId;
     $tradeFields = 'trade.status,trade.receiver_name,trade.user_id,trade.post_fee,trade.receiver_state,trade.receiver_city,trade.created_time,trade.receiver_district,trade.receiver_address,trade.receiver_mobile,trade.receiver_phone';
     $params['fields'] = 'aftersales_bn,shop_id,aftersales_type,sendback_data,sendconfirm_data,shop_explanation,admin_explanation,user_id,reason,evidence_pic,created_time,oid,tid,num,progress,status,sku,' . $tradeFields;
     try {
         $result = app::get('topshop')->rpcCall('aftersales.get', $params, 'seller');
     } catch (Exception $e) {
         redirect::action('topshop_ctl_aftersales@index')->send();
         exit;
     }
     $result['evidence_pic'] = $result['evidence_pic'] ? explode(',', $result['evidence_pic']) : null;
     $result['sendback_data'] = $result['sendback_data'] ? unserialize($result['sendback_data']) : null;
     $result['sendconfirm_data'] = $result['sendconfirm_data'] ? unserialize($result['sendconfirm_data']) : null;
     if ($result['user_id']) {
         $userName = app::get('topshop')->rpcCall('user.get.account.name', ['user_id' => $result['user_id']], 'seller');
         $pagedata['userName'] = $userName[$result['user_id']];
     }
     if ($result['sendback_data']['corp_code'] && $result['sendback_data']['corp_code'] != "other") {
         $logiData = explode('-', $result['sendback_data']['corp_code']);
         $result['sendback_data']['corp_code'] = $logiData[0];
         $result['sendback_data']['logi_name'] = $logiData[1];
         if ($result['sendback_data']['logi_no'] && $result['sendback_data']['corp_code']) {
             try {
                 $tracker = app::get('topshop')->rpcCall('logistics.tracking.get.hqepay', array('logi_no' => $result['sendback_data']['logi_no'], 'corp_code' => $result['sendback_data']['corp_code']));
             } catch (Exception $e) {
             }
             $pagedata['tracker'] = $tracker;
         }
     }
     if ($result['sendconfirm_data']['corp_code'] && $result['sendconfirm_data']['corp_code'] != "other") {
         $logiData = explode('-', $result['sendconfirm_data']['corp_code']);
         $result['sendconfirm_data']['corp_code'] = $logiData[0];
         $result['sendconfirm_data']['logi_name'] = $logiData[1];
         if ($result['sendconfirm_data']['logi_no'] && $result['sendconfirm_data']['corp_code']) {
             try {
                 $tracker = app::get('topshop')->rpcCall('logistics.tracking.get.hqepay', array('logi_no' => $result['sendconfirm_data']['logi_no'], 'corp_code' => $result['sendconfirm_data']['corp_code']));
             } catch (Exception $e) {
             }
             $pagedata['sendTracker'] = $tracker;
         }
     }
     //快遞公司代碼
     $params['fields'] = "corp_code,corp_name";
     $corpData = app::get('topshop')->rpcCall('logistics.dlycorp.get.list', $params);
     $pagedata['corpData'] = $corpData['data'];
     $pagedata['info'] = $result;
     return $this->page('topshop/aftersales/detail.html', $pagedata);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:50,代碼來源:aftersales.php

示例12: handle

 public function handle($request, Clousure $next)
 {
     $routeAs = route::currentRouteName();
     $currentPermission = shopAuth::getSellerPermission();
     //$currentPermission = false 表示為店主不用判斷權限
     //獲取當前用戶的路由權限
     if ($currentPermission && !in_array($routeAs, $currentPermission)) {
         if (request::ajax()) {
             return response::json(array('error' => true, 'message' => '無操作權限'));
         } else {
             return redirect::action('topshop_ctl_index@nopermission');
         }
     }
     return $next($request);
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:15,代碼來源:permission.php

示例13: __construct

 public function __construct(&$app)
 {
     parent::__construct();
     kernel::single('base_session')->start();
     if (!$this->action) {
         $this->action = 'index';
     }
     $this->action_view = $this->action . ".html";
     // 檢測是否登錄
     if (!userAuth::check()) {
         redirect::action('topc_ctl_passport@signin')->send();
         exit;
     }
     $this->limit = 20;
     $this->passport = kernel::single('topc_passport');
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:16,代碼來源:needgoods.php

示例14: ajaxFavshopDel

 /**
  * @brief 刪除店鋪收藏
  */
 function ajaxFavshopDel()
 {
     $userId = userAuth::id();
     if (!$userId) {
         return redirect::action('topm_ctl_passport@signin');
     }
     $params['shop_id'] = $_POST['shop_id'];
     $params['user_id'] = $userId;
     if (!$params['shop_id']) {
         return $this->splash('error', null, app::get('topm')->_('店鋪id不能為空!'));
     }
     if (!app::get('topm')->rpcCall('user.shopcollect.del', $params)) {
         return $this->splash('error', null, app::get('topm')->_('店鋪收藏刪除失敗!'));
     } else {
         return $this->splash('success', null, app::get('topm')->_('店鋪收藏刪除成功'));
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:20,代碼來源:collect.php

示例15: callback

 /**
  * callback返回頁, 同時是bind頁麵
  *
  * @return base_http_response
  */
 public function callback()
 {
     $params = input::get();
     $flag = $params['flag'];
     unset($params['flag']);
     // 信任登陸校驗
     $userTrust = kernel::single('pam_trust_user');
     $res = $userTrust->authorize($flag, 'web', 'topc_ctl_trustlogin@callBack', $params);
     $binded = $res['binded'];
     if ($binded) {
         $userId = $res['user_id'];
         userAuth::login($userId);
         return redirect::action('topc_ctl_default@index');
     } else {
         $pagedata = compact('flag');
         return $this->page('topc/bind.html', $pagedata);
     }
 }
開發者ID:453111208,項目名稱:bbc,代碼行數:23,代碼來源:trustlogin.php


注:本文中的redirect::action方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。