当前位置: 首页>>代码示例>>PHP>>正文


PHP Request::url方法代码示例

本文整理汇总了PHP中Illuminate\Support\Facades\Request::url方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::url方法的具体用法?PHP Request::url怎么用?PHP Request::url使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Illuminate\Support\Facades\Request的用法示例。


在下文中一共展示了Request::url方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: show

 function show()
 {
     //        dd(Page::all()->toArray());
     $page = Page::orWhere(function ($query) {
         $query->where('url', '=', Request::path());
     })->orWhere(function ($query) {
         $query->where('url', '=', '/' . Request::path());
     })->orWhere(function ($query) {
         $query->where('url', '=', Request::url());
     })->orWhere(function ($query) {
         $query->where('url', '=', Request::route()->getPath());
     })->orWhere(function ($query) {
         $query->where('url', '=', '/' . Request::route()->getPath());
     })->get()->first();
     $ps = Post::where('page_id', '=', $page->id)->orderBy('sort', 'ASC')->orderBy('id', 'ASC')->get();
     $posts = [];
     foreach ($page->template()->first()->sections() as $sec) {
         $posts[$sec->name] = [];
     }
     foreach ($ps as $p) {
         $posts[$p->section()->first()->name][] = $p;
     }
     $pages = [];
     foreach (Page::all() as $pi) {
         $pages[$pi->name] = $pi;
     }
     $fn = str_replace('.blade.php', '', $page->template()->first()->filename);
     return View::make("aui/templates/" . $fn)->with('posts', $posts)->with('pages', $pages)->with('page', $page);
 }
开发者ID:mj1618,项目名称:punto-cms,代码行数:29,代码来源:PageRoute.php

示例2: current

 public function current($uri = false)
 {
     if ($uri) {
         return Request::url();
     }
     return Request::fullUrl();
 }
开发者ID:parabol,项目名称:laravel-cms,代码行数:7,代码来源:Url.php

示例3: get

 public function get($breadcrumbs_data)
 {
     $bakery_data = [];
     foreach ($breadcrumbs_data as $route => $link_text) {
         $obj = new \stdClass();
         if ($route == '*') {
             $obj->url = Request::url();
             $obj->isCurrent = true;
         } else {
             $params = [];
             if (strpos($route, ':') !== false) {
                 list($route, $params) = explode(':', $route);
                 if (strpos($params, ',') !== false) {
                     $params = explode(',', $params);
                 } else {
                     $params = [$params];
                 }
             }
             $obj->url = route($route, $params);
             $obj->isCurrent = false;
         }
         $obj->title = $link_text;
         $bakery_data[] = $obj;
     }
     return $bakery_data;
 }
开发者ID:sukohi,项目名称:bakery,代码行数:26,代码来源:Bakery.php

示例4: buildSiteMap

 /**
  * Build the Site Map
  */
 protected function buildSiteMap()
 {
     $postsInfo = $this->getPostsInfo();
     $dates = array_values($postsInfo);
     sort($dates);
     $lastmod = last($dates);
     $url = str_finish(Request::url(), '/');
     $xml = [];
     $xml[] = '<?xml version="1.0" encoding="UTF-8"?' . '>';
     $xml[] = '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
     $xml[] = '  <url>';
     $xml[] = "    <loc>{$url}</loc>";
     $xml[] = "    <lastmod>11.1.1982</lastmod>";
     $xml[] = '    <changefreq>daily</changefreq>';
     $xml[] = '    <priority>0.8</priority>';
     $xml[] = '  </url>';
     foreach ($postsInfo as $slug => $lastmod) {
         $xml[] = '  <url>';
         $xml[] = "    <loc>{$url}haberci/{$slug}</loc>";
         $xml[] = "    <lastmod>11</lastmod>";
         $xml[] = "  </url>";
     }
     $xml[] = '</urlset>';
     return join("\n", $xml);
 }
开发者ID:doguhan,项目名称:deneme,代码行数:28,代码来源:SiteMap.php

示例5: put

 public function put(Route $route, Request $request, Response $response)
 {
     $key = $this->makeCacheKey($request->url());
     if (!Cache::has($key)) {
         Cache::put($key, $response->getContent(), 60);
     }
 }
开发者ID:DinanathThakur,项目名称:Flash-Sale-Ecommerce-Portal-PHP,代码行数:7,代码来源:CacheFilter.php

示例6: redirect

 /**
  * Redirect user to login using OAuth credentials.
  *
  * @return Illuminate\Support\Facades\Redirect $forward_url
  */
 public function redirect()
 {
     $comToken = $this->getNewComToken();
     Session::put('ComToken', $comToken);
     $callback = Request::url();
     $forward_url = $this->loginURL . "?ComToken=" . $comToken . "&callback_url=" . urlencode($callback);
     return Redirect::to($forward_url);
 }
开发者ID:ckylape,项目名称:oauth-with-db,代码行数:13,代码来源:OAuthWithDatabaseGuard.php

示例7: reportException

 /**
  * Report an exception.
  *
  * @param Exception $exception
  */
 public function reportException(Exception $exception)
 {
     try {
         $attributes = ['user_id' => $this->getUserId(), 'class' => get_class($exception), 'message' => $exception->getMessage(), 'file' => $exception->getFile(), 'line' => $exception->getLine(), 'trace' => $exception->getTraceAsString(), 'url' => Request::url(), 'ip' => $this->getIpAddress(), 'user_agent' => $this->getUserAgent(), 'created_at' => Carbon::now()];
         $this->getRepository()->insert($attributes);
         event(new ExceptionWasReported($exception));
     } catch (Exception $e) {
     }
 }
开发者ID:mirzabusatlic,项目名称:laravel-exceptions,代码行数:14,代码来源:ReportsExceptions.php

示例8: onRun

 public function onRun()
 {
     $settings = Settings::instance();
     $this->addCss('/plugins/hariadi/share/assets/css/share.css');
     foreach ($this->providers as $provider) {
         $this->page[$provider] = $settings->{$provider};
     }
     $this->page['url'] = Request::url();
 }
开发者ID:cobyan,项目名称:oc-share-plugin,代码行数:9,代码来源:Share.php

示例9: link

 private function link($column, $text, $direction)
 {
     $params = $this->_appends + [$this->_keys['order'] => $column, $this->_keys['direction'] => $direction];
     if (Request::has($this->_keys['order']) && Request::input($this->_keys['order']) == $column && Request::input($this->_keys['direction']) == $direction) {
         return $text;
     }
     if (empty($this->_url)) {
         $this->_url = Request::url();
     }
     return '<a href="' . $this->_url . '?' . http_build_query($params) . '">' . $text . '</a>';
 }
开发者ID:sukohi,项目名称:caruta,代码行数:11,代码来源:Caruta.php

示例10: _trackException

 /**
  * @param Exception $e
  */
 private function _trackException(Exception $e)
 {
     $list = Config::get('track.emails', []);
     if (count($list) !== 0) {
         Mail::send('emails.exception', array('url' => Request::url(), 'exception' => $e->getMessage()), function ($message) use($e, $list) {
             foreach ($list as $email) {
                 $message->to($email, '')->subject(Config::get('app.name') . ': Error ' . $e->getCode());
             }
         });
     }
 }
开发者ID:NewwayLibs,项目名称:nw-core,代码行数:14,代码来源:Handler.php

示例11: getCount

 public function getCount()
 {
     $count = $this->getCache();
     if (!is_null($count)) {
         return $count;
     }
     $url = 'https://api.tumblr.com/v2/share/stats?url=' . urlencode($this->getOption('url', Request::url()));
     $result = $this->fileGetContents($url);
     $count = isset($matches['response']['note_count']) ? $matches['response']['note_count'] : 0;
     $this->setCache($count);
     return $count;
 }
开发者ID:applevladko,项目名称:SocShare,代码行数:12,代码来源:Tumblr.php

示例12: save

 public static function save()
 {
     $self = strtok(Request::server('REQUEST_URI'), '?');
     $page = self::all();
     $page["back_post"] = Input::all();
     $page["back_url"] = Request::url();
     Session::put('rapyd.' . $self, $page);
     //var_export(Session::all());
     //echo "\n\n..";
     //var_export(Session::get('rapyd.'.$self.".back_post".".nome"));
     //die;
 }
开发者ID:parabol,项目名称:laravel-cms,代码行数:12,代码来源:Persistence.php

示例13: getSharedCount

 public function getSharedCount($url = '')
 {
     if (!$url) {
         $url = Request::url();
     }
     $link = 'https://api.facebook.com/method/links.getStats?format=json&urls=' . urlencode($url);
     $data = file_get_contents($link);
     $data = json_decode($data);
     // share_count
     $count = is_array($data) ? $data[0]->total_count : $data->total_count;
     return intval($count);
 }
开发者ID:OlesKashchenko,项目名称:LarShare,代码行数:12,代码来源:Facebook.php

示例14: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (Auth::check() === false) {
         Auth::logout();
         Session::put('return_url', Request::url());
         return redirect()->to('/admin-login');
     }
     if (Auth::user()->hasRole('admin') === false) {
         return (new Logout())->getLogout();
     }
     return $next($request);
 }
开发者ID:mj1618,项目名称:punto-cms,代码行数:19,代码来源:AdminAuth.php

示例15: getCount

 public function getCount()
 {
     $count = $this->getCache();
     if (!is_null($count)) {
         return $count;
     }
     $url = 'https://vk.com/share.php?act=count&index=1&url=' . urlencode($this->getOption('url', Request::url()));
     $result = $this->fileGetContents($url);
     preg_match('~VK\\.Share\\.count\\(\\d+,\\s*(\\d+)\\);~', $result, $matches);
     $count = isset($matches[1]) ? $matches[1] : 0;
     $this->setCache($count);
     return $count;
 }
开发者ID:applevladko,项目名称:SocShare,代码行数:13,代码来源:Vkontakte.php


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