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


PHP ResponseFactory::redirectTo方法代碼示例

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


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

示例1: authorize

 /**
  * Authorize the page.
  *
  * @param PageInterface $page
  */
 public function authorize(PageInterface $page)
 {
     /* @var UserInterface $user */
     $user = $this->guard->user();
     /**
      * If the page is not enabled and we
      * are not logged in then 404.
      */
     if (!$page->isEnabled() && !$user) {
         abort(404);
     }
     /**
      * If the page is not enabled and we are
      * logged in then make sure we have permission.
      */
     if (!$page->isEnabled()) {
         $this->authorizer->authorize('anomaly.module.pages::view_drafts');
     }
     /**
      * If the page is restricted to specific
      * roles then make sure our user is one of them.
      */
     $allowed = $page->getAllowedRoles();
     if (!$allowed->isEmpty() && (!$user || !$user->hasAnyRole($allowed))) {
         $page->setResponse($this->response->redirectTo('login'));
     }
 }
開發者ID:visualturk,項目名稱:pages-module,代碼行數:32,代碼來源:PageAuthorizer.php

示例2: handle

 /**
  * Handle the command.
  *
  * @param ResponseFactory $response
  * @param Request         $request
  */
 public function handle(ResponseFactory $response, Request $request)
 {
     /* @var TableBuilder $builder */
     foreach ($this->builder->getTables() as $builder) {
         $builder->post();
     }
     if (!$this->builder->getTableResponse()) {
         $this->builder->setTableResponse($response->redirectTo($request->fullUrl()));
     }
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:16,代碼來源:PostTables.php

示例3: handle

 /**
  * Handle the command.
  *
  * @param  Request         $request
  * @param  ResponseFactory $response
  * @throws \Exception
  */
 public function handle(Request $request, ResponseFactory $response)
 {
     if ($this->builder instanceof MultipleTableBuilder) {
         return;
     }
     $this->dispatch(new ExecuteAction($this->builder));
     if (!$this->builder->getTableResponse()) {
         $this->builder->setTableResponse($response->redirectTo($request->fullUrl()));
     }
 }
開發者ID:huglester,項目名稱:streams-platform,代碼行數:17,代碼來源:PostTable.php

示例4: redirectTo

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


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