本文整理汇总了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);
}
示例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.");
}
示例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;
}
示例4: __construct
public function __construct(&$app)
{
parent::__construct();
// 检测是否登录
if (!userAuth::check()) {
redirect::action('topc_ctl_passport@signin')->send();
exit;
}
}
示例5: __construct
public function __construct(&$app)
{
parent::__construct();
// 检测是否登录
if (!userAuth::check()) {
redirect::action('topm_ctl_passport@signin')->send();
exit;
}
$this->setLayoutFlag('cart');
}
示例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;
}
示例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);
}
示例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);
}
示例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;
}
}
示例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();
}
}
示例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);
}
示例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);
}
示例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');
}
示例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')->_('店铺收藏删除成功'));
}
}
示例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);
}
}