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


PHP Request::path方法代碼示例

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


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

示例1: handle

 /**
  * This middleware forces the entire application to use SSL. We like that, because it's secure.
  *
  * Shamelessly copied from: http://stackoverflow.com/questions/28402726/laravel-5-redirect-to-https
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     $force = env('FORCE_DOMAIN', null);
     if ($force != null && $request->getHttpHost() != $force) {
         return redirect()->to(env('APP_URL') . '/' . ($request->path() == '/' ? '' : $request->path()));
     }
     return $next($request);
 }
開發者ID:saproto,項目名稱:saproto,代碼行數:17,代碼來源:ForceDomain.php

示例2: guess

 /**
  * Guess the HREF for the views.
  *
  * @param TableBuilder $builder
  */
 public function guess(TableBuilder $builder)
 {
     $views = $builder->getViews();
     foreach ($views as &$view) {
         // Only automate it if not set.
         if (!isset($view['attributes']['href'])) {
             $view['attributes']['href'] = $this->url->to($this->request->path() . '?' . array_get($view, 'prefix') . 'view=' . $view['slug']);
         }
     }
     $builder->setViews($views);
 }
開發者ID:huglester,項目名稱:streams-platform,代碼行數:16,代碼來源:HrefGuesser.php

示例3: handle

 /**
  * Handle an incoming request.
  *
  * @param \Illuminate\Http\Request $request
  * @param \Closure $next
  * @param integer $key
  * @return mixed
  */
 public function handle($request, Closure $next, $key)
 {
     if (Cache::has($request->path() . '-' . $key)) {
         return Cache::get($request->path() . '-' . $key);
     }
     return $next($request);
 }
開發者ID:sonusbeat,項目名稱:soundcore,代碼行數:15,代碼來源:FetchCacheOutput.php

示例4: handle

 /**
  * Disable sessions for requests to the acs endpoint
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (strpos($request->path(), 'access-control/') === 0 || $request->path() === 'acs' || $request->path() === 'acs/spark') {
         $this->app['config']->set('session.driver', 'array');
     }
     return $next($request);
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:14,代碼來源:ACSSessionControl.php

示例5: handle

 /**
  * Handle the event.
  */
 public function handle()
 {
     if (!$this->config->get('app.debug') && !$this->session->get(__CLASS__ . 'warned') && $this->request->path() == 'admin/dashboard' && $this->modules->get('anomaly.module.installer')) {
         $this->session->set(__CLASS__ . 'warned', true);
         $this->messages->error('streams::message.delete_installer');
     }
 }
開發者ID:huglester,項目名稱:streams-platform,代碼行數:10,代碼來源:CheckIfInstallerExists.php

示例6: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->check() && \Hash::check($this->auth->user()->getNumber(), $this->auth->user()->getPassword()) && $request->path() != 'my/password' && $request->path() != 'logout') {
         return redirect()->route('front.my.password')->with('danger-message', trans('site.You have to change your password'));
     }
     return $next($request);
 }
開發者ID:siegessa,項目名稱:uzem,代碼行數:14,代碼來源:CheckUserPassword.php

示例7: getEdit

 public function getEdit(Request $request)
 {
     $id = intval(substr($request->path(), strrpos($request->path(), '/') + 1));
     $sample = $this->sample->getById($id);
     $producers = $this->producer->getAll();
     return view('website.user.samples.edit')->with(['browserTitle' => str_replace('{wildcard}', $sample->generated_number, trans('sample.edit_sample_wildcard')), 'mainArea' => 'samples', 'subArea' => 'edit', 'sample' => $sample, 'producers' => $producers]);
 }
開發者ID:manogi,項目名稱:gfw-qm,代碼行數:7,代碼來源:UserSampleController.php

示例8: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     //Don't add the header to acs requests
     if (strpos($request->path(), 'access-control/') === 0 || $request->path() === 'acs' || $request->path() === 'acs/spark') {
         return $next($request);
     }
     return $next($request)->header('Built-By', 'arthurguy.co.uk');
 }
開發者ID:adamstrawson,項目名稱:BBMembershipSystem,代碼行數:15,代碼來源:BrandingHeaders.php

示例9: make

 /**
  * Make the page breadcrumbs.
  *
  * @param PageInterface $page
  */
 public function make(PageInterface $page)
 {
     $breadcrumbs = [$page->getTitle() => $this->request->path()];
     $this->loadParent($page, $breadcrumbs);
     foreach (array_reverse($breadcrumbs) as $key => $url) {
         $this->breadcrumbs->add($key, $url);
     }
 }
開發者ID:jacksun101,項目名稱:pages-module,代碼行數:13,代碼來源:PageBreadcrumb.php

示例10: matches

 /**
  * Validate a given rule against a route and request.
  *
  * @param  \Illuminate\Routing\Route $route
  * @param  \Illuminate\Http\Request $request
  *
  * @return bool
  */
 public function matches(Route $route, Request $request)
 {
     $regex = $route->getCompiled()->getRegex();
     if (str_contains($request->getRequestUri(), '/wp-admin')) {
         return preg_match(str_replace('$#s', '(?:&.+)?$#s', $regex), rawurldecode($request->getRequestUri()));
     }
     $path = $request->path() == '/' ? '/' : '/' . $request->path();
     return preg_match($regex, rawurldecode($path));
 }
開發者ID:lara-press,項目名稱:framework,代碼行數:17,代碼來源:UriValidator.php

示例11: handle

 /**
  * Handle the event.
  */
 public function handle()
 {
     if ($this->request->path() == 'admin/login') {
         $this->breadcrumbs->add('streams::breadcrumb.login', '#');
     }
     if ($this->request->path() == 'installer/install') {
         $this->breadcrumbs->add('streams::breadcrumb.install', '#');
     }
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:12,代碼來源:GuessBreadcrumbs.php

示例12: handle

 /**
  * Verify the incoming request is via an ssl connection unless its on an approved url
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (!$request->isSecure() && env('FORCE_SECURE', 'true')) {
         if (strpos($request->path(), 'access-control/') !== 0 && $request->path() !== 'acs' && $request->path() !== 'acs/spark') {
             return redirect()->secure($request->path());
         }
     }
     return $next($request);
 }
開發者ID:paters936,項目名稱:BBMembershipSystem,代碼行數:16,代碼來源:SSLOnly.php

示例13: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::user()) {
         Log::info('Admin user is in ID:' . Auth::user()->id . ', email:' . Auth::user()->email . ', Path:' . $request->path() . ', Env:' . env('HTTP_USER_AGENT', 'unrecognized') . ', Time:' . date('Y-m-d H:i:s', time()));
     } else {
         Log::info('Guest user is in ' . 'Path:' . $request->path() . ', Env:' . env('HTTP_USER_AGENT', 'unrecognized') . ', Time:' . date('Y-m-d H:i:s', time()));
     }
     return $next($request);
 }
開發者ID:szcrystal,項目名稱:woau_backup,代碼行數:16,代碼來源:LogMiddleware.php

示例14: getUriWithoutLocale

 /**
  * Return requested uri without locale.
  *
  * @return string
  */
 public function getUriWithoutLocale()
 {
     $current = $this->getUriLocale();
     $default = $this->getDefaultLocale();
     $path = $this->request->path();
     if ($current == $default) {
         return $path;
     }
     return preg_replace('/' . $current . '\\/?/', '', $path);
 }
開發者ID:kiaking,項目名稱:laravel-locale,代碼行數:15,代碼來源:Manager.php

示例15: handle

 /**
  * Handle the event.
  */
 public function handle()
 {
     if (in_array($this->request->path(), ['admin/logout'])) {
         return;
     }
     if ($this->request->segment(1) !== 'admin') {
         return;
     }
     $this->template->put('cp', $this->controlPanel->build());
 }
開發者ID:jacksun101,項目名稱:streams-platform,代碼行數:13,代碼來源:LoadControlPanel.php


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