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