当前位置: 首页>>代码示例>>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;未经允许,请勿转载。