当前位置: 首页>>代码示例>>PHP>>正文


PHP Redirect::refresh方法代码示例

本文整理汇总了PHP中Redirect::refresh方法的典型用法代码示例。如果您正苦于以下问题:PHP Redirect::refresh方法的具体用法?PHP Redirect::refresh怎么用?PHP Redirect::refresh使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Redirect的用法示例。


在下文中一共展示了Redirect::refresh方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: store

 /**
  * Save a new status
  *
  * @return Response
  */
 public function store()
 {
     $this->publishStatusForm->validate(Input::only('body'));
     $this->execute(new PublishStatusCommand(Input::get('body'), Auth::user()->id));
     Flash::message('Your status has been updated!');
     return Redirect::refresh();
 }
开发者ID:billwaddyjr,项目名称:larabook,代码行数:12,代码来源:StatusController.php

示例2: login

 /**
  * Process login, only for POST http method
  *
  * @return \Illuminate\Http\RedirectResponse
  */
 public function login()
 {
     /**
      * Get input values
      */
     $credentials = array('username' => Input::get('username'), 'password' => Input::get('password'));
     /**
      * Get remember me checkbox value ('on' or null)
      */
     $rememberme = Input::get('rememberme', false);
     /**
      * Check username or password is not empty
      */
     if ($credentials['username'] == '' or $credentials['password'] == '') {
         return Redirect::route('login')->withInput(Input::except('password'))->with('error', 'Username or password cannot be blank');
     }
     /**
      * Attempt to authenticate
      */
     if (Auth::attempt($credentials, $rememberme)) {
         /**
          * Get session variable 'redirect' for previous page
          */
         if ($url = Session::get('redirect', false)) {
             Session::forget('redirect');
             return Redirect::to($url);
         }
         return Redirect::refresh();
     }
     /**
      * If authentication failed, redirect to login page
      */
     return Redirect::route('login')->withInput(Input::except('password'))->with('error', 'Wrong username or password');
 }
开发者ID:restricted,项目名称:authchain,代码行数:39,代码来源:AuthController.php

示例3: validate

 /**
  * Shortcut for request data validation.
  *
  * Ex:
  * <code>
  *  $err = Util::validate(...);
  *  if ($err) return $err;
  * </code>
  *
  * @param array $rules
  * @param array $messages
  * @param array $customAttributes
  *
  * @return bool|\Illuminate\Http\RedirectResponse
  */
 public static function validate(array $rules, array $messages = array(), array $customAttributes = array())
 {
     $validator = Validator::make(Input::all(), $rules, $messages, $customAttributes);
     if ($validator->fails()) {
         self::flash(Lang::get('app.formValidationFailed'));
         return Redirect::refresh()->withErrors($validator)->withInput();
     }
     return false;
 }
开发者ID:hramose,项目名称:laravel5-adminLTE-1,代码行数:24,代码来源:util.php

示例4: create

 /**
  * creates a new post
  * logs you in as anonymous if you are logged out
  * redirects to new post on success or back on error
  *
  * @param string  $section_title
  * @return Illuminate\Http\RedirectResponse
  */
 public function create($section_title)
 {
     $anon = $this->anon->make(Input::get('captcha'));
     if (!$anon->success) {
         return Redirect::refresh()->withErrors($anon->errorMessage())->withInput();
     }
     $post = $this->post->make(Input::get('section', ''), Input::get('data', ''), Input::get('title', ''), Input::get('url', ''), Input::get('nsfw-tag', 0), Input::get('nsfl-tag', 0), $this->section);
     if ($post->success) {
         $location = sprintf("/s/%s/posts/%s/%s", $post->data->section_title, $post->data->item_id, $post->data->item_title);
         return Redirect::to($location);
     } else {
         return Redirect::back()->withErrors($post->errorMessage())->withInput();
     }
 }
开发者ID:hrenos,项目名称:spreadit,代码行数:22,代码来源:PostController.php

示例5: postInscription

 /**
  * Traitement du formulaire d'inscription
  *
  * @return Redirect
  */
 public function postInscription()
 {
     $v = User::validate(Input::all());
     if ($v->passes()) {
         $user = new User();
         $user->username = Input::get('username');
         $user->email = Input::get('email');
         $user->password = Hash::make(Input::get('password'));
         $user->confirmation_code = str_random(30);
         $data = array('confirmation_code' => $user->confirmation_code);
         Mail::send('mail.layout', $data, function ($message) {
             $message->to(Input::get('email'), Input::get('username'))->subject('Echyzen : Verify your email address');
         });
         $user->save();
         return Redirect::back()->with('flash_notice', 'Votre compte a été créé.');
     }
     return Redirect::refresh()->withErrors($v)->withInput();
 }
开发者ID:Anassdev,项目名称:Laravel-Echyzen,代码行数:23,代码来源:AuthController.php

示例6: moder

 public function moder($id)
 {
     /**
      * @var $obj Vacancy
      */
     $obj = Vacancy::findOrFail($id);
     if (!empty($_POST)) {
         $data = Input::only(array('active', 'email', 'title', 'text'));
         $validation = $obj->validate($data);
         if ($validation->fails()) {
             return Redirect::refresh()->with('message', array('text' => $validation->errors()->first()))->withInput($data);
         } else {
             $obj->fill($data);
             $obj->save();
             return Redirect::refresh()->with('message', array('text' => 'Вакансия успешно сохранена'));
         }
     }
     return View::make('vacancies.moder', array('item' => $obj));
 }
开发者ID:unlike777,项目名称:relevant.test,代码行数:19,代码来源:VacanciesController.php

示例7: function

<?php

Route::get('buy', function () {
    return View::make('buy');
});
Route::post('buy', function () {
    $billing = App::make('Acme\\Billing\\BillingInterface');
    try {
        $customerId = $billing->charge(['email' => Input::get('email'), 'token' => Input::get('stripe-token')]);
        $user = User::first();
        $user->billing_id = $customerId;
        $user->save();
    } catch (Exception $e) {
        return Redirect::refresh()->withFlashMessage($e->getMessage());
    }
    return 'Charge was successful';
});
开发者ID:jasonrking,项目名称:Billing-With-Stripe,代码行数:17,代码来源:routes.php


注:本文中的Redirect::refresh方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。