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


PHP Routing\Redirector類代碼示例

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


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

示例1: connect

 /**
  * Connect the current user to Last.fm.
  *
  * @param Redirector $redirector
  * @param Lastfm     $lastfm
  *
  * @return \Illuminate\Routing\Redirector|\Illuminate\Http\RedirectResponse
  */
 public function connect(Redirector $redirector, Lastfm $lastfm)
 {
     if (!$lastfm->enabled()) {
         abort(401, 'Koel is not configured to use with Last.fm yet.');
     }
     return $redirector->to('https://www.last.fm/api/auth/?api_key=' . $lastfm->getKey() . '&cb=' . route('lastfm.callback'));
 }
開發者ID:bearzk,項目名稱:koel,代碼行數:15,代碼來源:LastfmController.php

示例2: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function store(Request $request, Redirector $redirect)
 {
     $rules = array('first_name' => 'required', 'last_name' => 'required', 'email' => 'required|email|unique:users,email', 'password' => 'required|size:6', 'type' => 'required|in:user,admin');
     $this->validate($request, $rules);
     $user = User::create($request->all());
     return $redirect->route('admin.users.index');
 }
開發者ID:robertobustamante,項目名稱:laravel,代碼行數:13,代碼來源:UsersController.php

示例3: handle

 /**
  * Handle the form.
  *
  * @param PermissionFormBuilder   $builder
  * @param RoleRepositoryInterface $roles
  * @param Redirector              $redirect
  */
 public function handle(PermissionFormBuilder $builder, RoleRepositoryInterface $roles, Redirector $redirect)
 {
     /* @var RoleInterface|EloquentModel $role */
     $role = $builder->getEntry();
     $roles->save($role->setAttribute('permissions', array_filter(array_flatten($builder->getFormInput()))));
     $builder->setFormResponse($redirect->refresh());
 }
開發者ID:jacksun101,項目名稱:users-module,代碼行數:14,代碼來源:PermissionFormHandler.php

示例4: requestCreateNewModel

 /**
  * Request a new page be created
  *
  * @param  array $input
  * @return Redirector
  */
 public function requestCreateNewModel($input)
 {
     $scaffolding = $this->ScaffoldingManager->makeScaffolding($input, $this->CrudScaffolding);
     if ($scaffolding) {
         return $this->Redirect->route('dvs-dashboard');
     }
     return $this->Redirect->route('dvs-models-create')->withInput()->withErrors($this->ScaffoldingManager->errors)->with('message', $this->ScaffoldingManager->message);
 }
開發者ID:devisephp,項目名稱:cms,代碼行數:14,代碼來源:ScaffoldingResponseHandler.php

示例5: handle

 /**
  * Handle the command.
  *
  * @param RedirectRepositoryInterface $redirects
  * @param Redirector                  $redirector
  * @param Parser                      $parser
  * @param Route                       $route
  * @return \Illuminate\Http\RedirectResponse
  */
 public function handle(RedirectRepositoryInterface $redirects, Redirector $redirector, Parser $parser, Route $route)
 {
     $redirect = $redirects->find($this->id);
     $parameters = array_merge(array_map(function () {
         return null;
     }, array_flip($route->parameterNames())), $route->parameters());
     return $redirector->to($parser->parse($redirect->getTo(), $parameters), $redirect->getStatus(), [], $redirect->isSecure());
 }
開發者ID:AkibaTech,項目名稱:redirects-module,代碼行數:17,代碼來源:GetRedirectResponse.php

示例6: 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

示例7: requestDestroyPage

 /**
  * Request the page be deleted from database
  *
  * @param  integer $id
  * @return Redirector
  */
 public function requestDestroyPage($id)
 {
     $page = $this->ApiPagesManager->destroyPage($id);
     if ($page) {
         return $this->Redirect->route('dvs-api')->with('message', 'Request successfully removed');
     }
     return $this->Redirect->route('dvs-api')->withInput()->withErrors($this->ApiPagesManager->errors)->with('message', $this->ApiPagesManager->message);
 }
開發者ID:devisephp,項目名稱:cms,代碼行數:14,代碼來源:ApiPagesResponseHandler.php

示例8: filter

 public function filter(Route $route, Request $request)
 {
     if ($this->auth->check()) {
         $config = $this->config->get('c::redirect-login');
         $url = $config ? $this->url->to($config) : '/';
         return $this->redirect->to($url);
     }
 }
開發者ID:anlutro,項目名稱:l4-core,代碼行數:8,代碼來源:GuestFilter.php

示例9: postFork

 public function postFork($hash)
 {
     $parent = $this->repository->getByHash($hash);
     $command = new Commands\CreateForkCommand($this->request->get('code'), $this->auth->user(), $parent);
     $fork = $this->bus->execute($command);
     return $this->redirector->action('BinController@getShow', [$fork->hash]);
 }
開發者ID:sdlyhu,項目名稱:laravelio,代碼行數:7,代碼來源:BinController.php

示例10: failedResponse

 /**
  * @param  string $middleware
  * @param  bool   $isAjax
  * @return \Illuminate\Http\RedirectResponse
  */
 protected function failedResponse($middleware, $isAjax = false)
 {
     if ($isAjax) {
         return $this->response->make($this->getErrorMessage($middleware), 403);
     }
     return $this->redirector->back()->exceptInput('_guard_pot', '_guard_opened')->withErrors($this->getErrorMessage($middleware));
 }
開發者ID:ryanwinchester,項目名稱:laravel-spamguard,代碼行數:12,代碼來源:Middleware.php

示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param Request $request
  * @param Closure $next
  *
  * @return mixed
  */
 public function handle(Request $request, Closure $next)
 {
     if (!$request->isSecure()) {
         return $this->redirector->to($request->getRequestUri(), 302, $request->headers->all(), true);
     }
     return $next($request);
 }
開發者ID:hughgrigg,項目名稱:ching-shop,代碼行數:15,代碼來源:ForceSecure.php

示例12: handle

 /**
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$this->authenticator->isAuthenticated()) {
         return $this->redirector->to($this->config->get('littlegatekeeper.authRoute'));
     }
     return $next($request);
 }
開發者ID:spatie,項目名稱:laravel-littlegatekeeper,代碼行數:12,代碼來源:AuthMiddleware.php

示例13: requestUpdate

 /**
  * Update a Menu
  *
  * @param  integer $id
  * @param  array   $input
  * @return Redirect
  */
 public function requestUpdate($id, $input)
 {
     if ($this->Manager->updateMenu($id, $input)) {
         return $this->Redirect->route('dvs-menus');
     }
     return $this->Redirect->route('dvs-menus-edit', $id)->withInput()->withErrors($this->Manager->errors)->with('message', $this->Manager->message);
 }
開發者ID:devisephp,項目名稱:cms,代碼行數:14,代碼來源:MenusResponseHandler.php

示例14: getDelete

 public function getDelete(Post $ad)
 {
     if ($ad) {
         $ad->delete();
     }
     return $this->redirector->route('ad.list');
 }
開發者ID:PhonemeCms,項目名稱:cms,代碼行數:7,代碼來源:AdController.php

示例15: create

 /**
  * Create a new Redirect response.
  *
  * @param RedirectInterface $redirect
  * @return \Illuminate\Http\RedirectResponse
  */
 public function create(RedirectInterface $redirect)
 {
     $parameters = array_merge(array_map(function () {
         return null;
     }, array_flip($this->route->parameterNames())), $this->route->parameters());
     return $this->redirector->to($this->parser->parse($redirect->getTo(), $parameters), $redirect->getStatus(), [], $redirect->isSecure());
 }
開發者ID:JoelESvensson,項目名稱:redirects-module,代碼行數:13,代碼來源:RedirectResponse.php


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