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


PHP Redirector::intended方法代碼示例

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


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

示例1: handle

 /**
  * Handle the form.
  *
  * @param LoginFormBuilder  $builder
  * @param UserAuthenticator $authenticator
  * @param Redirector        $redirect
  */
 public function handle(LoginFormBuilder $builder, UserAuthenticator $authenticator, Redirector $redirect)
 {
     if (!($user = $builder->getUser())) {
         return;
     }
     $authenticator->login($user, $builder->getFormValue('remember_me'));
     $builder->setFormResponse($redirect->intended($builder->getFormOption('redirect', '/')));
 }
開發者ID:AkibaTech,項目名稱:users-module,代碼行數:15,代碼來源:LoginFormHandler.php

示例2: handle

 /**
  * Handle the form.
  *
  * @param LoginFormBuilder  $builder
  * @param UserAuthenticator $authenticator
  * @param UserSecurity      $security
  * @param Redirector        $redirect
  */
 public function handle(LoginFormBuilder $builder, UserAuthenticator $authenticator, UserSecurity $security, Redirector $redirect)
 {
     if (!($user = $builder->getUser())) {
         return;
     }
     $response = $security->check($user);
     if ($response instanceof Response) {
         $authenticator->logout($user);
         $builder->setFormResponse($response);
         return;
     }
     $authenticator->login($user, $builder->getFormValue('remember_me'));
     $builder->setFormResponse($redirect->intended($builder->getFormOption('redirect', '/')));
 }
開發者ID:jacksun101,項目名稱:users-module,代碼行數:22,代碼來源:LoginFormHandler.php

示例3: postIndex

 /**
  * Show the login form
  *
  * @return mixed
  */
 public function postIndex()
 {
     // Pick up the honeypot field to stop bots, return to the login screen, no message
     if ($this->request->get('potter')) {
         return $this->redirect->to('auth/login')->withInput();
     }
     if (!$this->validator->with($this->request->all())->passes()) {
         return $this->redirect->to('auth/login')->withErrors($this->validator->errors());
     }
     if ($this->auth->attempt(['username' => $this->request->get('username'), 'password' => $this->request->get('password')])) {
         return $this->redirect->intended('/');
     }
     $this->session->flash('failed', trans('auth.incorrect_username_or_password'));
     return $this->redirect->to('auth/login')->withInput();
 }
開發者ID:jraymundoyrockdev,項目名稱:api-gfccm-systems,代碼行數:20,代碼來源:AuthController.php

示例4: intended

 /**
  * Create a new redirect response to the previously intended location.
  *
  * @param string $default
  * @param int $status
  * @param array $headers
  * @param bool $secure
  * @return \Illuminate\Http\RedirectResponse 
  * @static 
  */
 public static function intended($default = '/', $status = 302, $headers = array(), $secure = null)
 {
     return \Illuminate\Routing\Redirector::intended($default, $status, $headers, $secure);
 }
開發者ID:satriashp,項目名稱:tour,代碼行數:14,代碼來源:_ide_helper.php

示例5: redirectToIntended

 /**
  * Create a new redirect response to the previously intended location.
  *
  * @param  string  $default
  * @param  int     $status
  * @param  array   $headers
  * @param  bool    $secure
  * @return \Symfony\Component\HttpFoundation\Response
  */
 public function redirectToIntended($default = '/', $status = 302, $headers = array(), $secure = null)
 {
     return $this->redirector->intended($default, $status, $headers, $secure);
 }
開發者ID:visualturk,項目名稱:framework,代碼行數:13,代碼來源:ResponseFactory.php


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