• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Routing\Redirector类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Illuminate\Routing\Redirector的典型用法代码示例。如果您正苦于以下问题:PHP Redirector类的具体用法?PHP Redirector怎么用?PHP Redirector使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Redirector类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id, Personne $Personne, Request $request, Redirector $redirect)
 {
     // return var_dump(Input::all());
     // return 'update de la fiche '.$id;
     $Personne->update($id, $request);
     // return $redirect->back();
     return $redirect->action('PersonneController@index');
 }
开发者ID:gAb09,项目名称:NetP,代码行数:14,代码来源:AdherentController.php


示例9: update

 public function update(MenuItem $item, Request $request, Redirector $redirector)
 {
     if ($request->input('display_order') > $item->displayOrder) {
         $item->moveDown();
     } else {
         $item->moveUp();
     }
     return $redirector->route('admin.menu.index');
 }
开发者ID:jeroennoten,项目名称:laravel-menu,代码行数:9,代码来源:MenuAdminController.php


示例10: view

 /**
  * Redirect to a post's URL.
  *
  * @param PostRepositoryInterface $posts
  * @param Redirector              $redirect
  * @param                         $id
  * @return \Illuminate\Http\RedirectResponse
  */
 public function view(PostRepositoryInterface $posts, Redirector $redirect, $id)
 {
     /* @var PostInterface $post */
     $post = $posts->find($id);
     if (!$post->isLive()) {
         return $redirect->to($this->dispatch(new GetPostPath($post)));
     }
     return $redirect->to($post->path());
 }
开发者ID:jacksun101,项目名称:posts-module,代码行数:17,代码来源:PostsController.php


示例11: handle

 /**
  * Handle the command.
  *
  * @param StandardFormBuilder $builder
  * @return StandardFormBuilder
  */
 public function handle(StandardFormBuilder $builder, Redirector $redirect)
 {
     $stream = $this->form->getFormEntriesStream();
     $builder->on('saved', function (FormMailer $mailer, FormAutoresponder $autoresponder) use($builder) {
         $mailer->send($this->form, $builder);
         $autoresponder->send($this->form, $builder);
     });
     return $builder->setActions(['submit'])->setModel($stream->getEntryModel())->setOption('panel_class', 'section')->setOption('enable_defaults', false)->setOption('url', 'forms/handle/' . $this->form->getFormSlug())->setOption('success_message', $this->form->getSuccessMessage() ?: false)->setOption('redirect', $this->form->getSuccessRedirect() ?: $redirect->back());
 }
开发者ID:anomalylabs,项目名称:standard_form-extension,代码行数:15,代码来源:GetStandardFormBuilder.php


示例12: handle

 /**
  * Save the order of the entries.
  *
  * @param SectionCollection $sections
  * @param TableBuilder      $builder
  * @param array             $selected
  */
 public function handle(SectionCollection $sections, Redirector $redirector, TableBuilder $builder, array $selected)
 {
     $prefix = $builder->getTableOption('prefix');
     $edit = array_shift($selected);
     $ids = implode(',', $selected);
     if ($section = $sections->active()) {
         $builder->setTableResponse($redirector->to($section->getHref('edit/' . $edit . '?' . $prefix . 'edit_next=' . $ids)));
     }
 }
开发者ID:huglester,项目名称:streams-platform,代码行数:16,代码来源:Edit.php


示例13: handle

 /**
  * Handle the form.
  *
  * @param PermissionFormBuilder   $builder
  * @param RoleRepositoryInterface $roles
  * @param Redirector              $redirect
  */
 public function handle(PermissionFormBuilder $builder, RoleRepositoryInterface $roles, Redirector $redirect)
 {
     /* @var RoleInterface $role */
     $role = $builder->getEntry();
     $roles->save($role->setPermissions(array_keys(array_dot(array_map(function ($values) {
         return array_combine(array_values($values), array_pad([], count($values), true));
     }, array_filter($builder->getFormInput()))))));
     $builder->setFormResponse($redirect->refresh());
 }
开发者ID:tobz-nz,项目名称:users-module,代码行数:16,代码来源:PermissionFormHandler.php


示例14: store

 public function store(Request $request, Redirector $redirect)
 {
     $view = View::make();
     $view->save();
     $page = Page::make($request->input('uri'));
     $page->view()->associate($view);
     $page->save();
     return $redirect->route('admin.pages.edit', $page);
 }
开发者ID:jeroennoten,项目名称:laravel-pages,代码行数:9,代码来源:PageController.php


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


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


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


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


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


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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Routing\ResponseFactory类代码示例发布时间:2022-05-23
下一篇:
PHP Routing\Controller类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap