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


PHP URL::current方法代碼示例

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


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

示例1: setData

 public function setData()
 {
     $current_page = $this->getPage(URL::current());
     if (Input::all()) {
         session()->put("{$this->prefix}.data." . $current_page['alias'], Input::all());
     }
 }
開發者ID:wolle404,項目名稱:multipage,代碼行數:7,代碼來源:Multipage.php

示例2: loadPageTitle

 private function loadPageTitle()
 {
     $pageTitles = config('forone.nav_titles');
     $curRouteName = Route::currentRouteName();
     if (array_key_exists($curRouteName, $pageTitles)) {
         return $pageTitles[$curRouteName];
     } else {
         // load menus title
         $url = URL::current();
         $menus = config('forone.menus');
         foreach ($menus as $title => $menu) {
             if (array_key_exists('children', $menu) && $menu['children']) {
                 foreach ($menu['children'] as $childTitle => $child) {
                     $pageTitle = $this->parseTitle($childTitle, $url, $child['active_uri']);
                     if ($pageTitle) {
                         return $pageTitle;
                     }
                 }
             } else {
                 $pageTitle = $this->parseTitle($title, $url, $menu['active_uri']);
                 if ($pageTitle) {
                     return $pageTitle;
                 }
             }
         }
     }
     return $curRouteName;
 }
開發者ID:Mrzhanglu,項目名稱:ForoneAdmin,代碼行數:28,代碼來源:BaseController.php

示例3: sortUrl

 public static function sortUrl($columns)
 {
     $columns = (array) $columns;
     $input = Input::get();
     $key = Config::get('epi::epi.keys.sort');
     $sorters = array();
     foreach ($columns as $column) {
         $input[$key][$column] = static::getDirection($column);
     }
     return URL::current() . '?' . http_build_query($input, null, '&');
 }
開發者ID:vespakoen,項目名稱:epi,代碼行數:11,代碼來源:EpiHTML.php

示例4: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->guest()) {
         Session::flash('redirectTo', URL::current());
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest('auth/login');
         }
     }
     return $next($request);
 }
開發者ID:noikiy,項目名稱:Laravel-5-Helpdesk,代碼行數:19,代碼來源:Authenticate.php

示例5: isActive

 /**
  * Set the active class to the current opened menu.
  *
  * @param  string|array $route
  * @param  string       $className
  * @return string
  */
 function isActive($route, $className = 'active')
 {
     if (is_array($route)) {
         return in_array(Route::currentRouteName(), $route) ? $className : '';
     }
     if (Route::currentRouteName() == $route) {
         return $className;
     }
     if (strpos(URL::current(), $route)) {
         return $className;
     }
 }
開發者ID:shammadahmed,項目名稱:LaravelHelpers,代碼行數:19,代碼來源:helpers.php

示例6: setDefaultsFromFile

 /**
  * Set the metadata from a file.
  *
  * @param string $file
  */
 public function setDefaultsFromFile($file)
 {
     $file = new Reader($file);
     // Fetch columns
     $rows = $file->fetchOne();
     $file->setOffset(1);
     // Fetch entries and set defaults
     $entries = $file->fetchAssoc($rows);
     foreach ($entries as $entry) {
         if (strpos(URL::current(), $entry['url']) !== false) {
             $this->defaults = $entry;
         }
     }
 }
開發者ID:anahkiasen,項目名稱:arrounded,代碼行數:19,代碼來源:Metadata.php

示例7: service

 /**
  * Return an instance of the requested service.
  *
  * @param string $provider
  * @param string $url
  * @param array  $scope
  * 
  * @return \OAuth\Common\Service\AbstractService
  * @throws \Exception
  */
 public function service($provider, $url = null, $scope = null)
 {
     $info = Config::get('laravel-social::providers.' . strtolower($provider));
     if (empty($info) || !is_array($info)) {
         throw new Exception('Missing configuration details for Social service: ' . $provider);
     }
     $client_id = array_get($info, 'client_id');
     $client_secret = array_get($info, 'client_secret');
     $scope = is_null($scope) ? array_get($info, 'scope') : $scope;
     if (empty($client_id) || empty($client_secret)) {
         throw new Exception('Missing client id/secret for Social service: ' . $provider);
     }
     return $this->factory->createService(ucfirst($provider), new Credentials($client_id, $client_secret, $url ?: URL::current()), $this->storage, $scope);
 }
開發者ID:mmanos,項目名稱:laravel-social,代碼行數:24,代碼來源:Social.php

示例8: isActive

 public function isActive($uri)
 {
     if (strripos($uri, '|')) {
         $uris = explode('|', $uri);
         foreach ($uris as $name) {
             if (strripos(URL::current(), $name)) {
                 return 'active';
             }
         }
     } else {
         if (strripos(URL::current(), $uri)) {
             return 'active';
         }
     }
     return '';
 }
開發者ID:Mrzhanglu,項目名稱:ForoneAdmin,代碼行數:16,代碼來源:NavService.php

示例9: isActive

 public function isActive($value)
 {
     $uri = array_key_exists('uri', $value) ? $value['uri'] : '';
     if (!$uri) {
         $children = $value['children'];
         foreach ($children as $child) {
             if (strripos(URL::current(), $child['uri'])) {
                 return 'active';
             }
         }
     } else {
         if (strripos(URL::current(), $uri)) {
             return 'active';
         }
     }
     return '';
 }
開發者ID:Mrzhanglu,項目名稱:ForoneAdministrator,代碼行數:17,代碼來源:NavService.php

示例10: loadPageTitle

 private function loadPageTitle()
 {
     $menus = config('forone.menus');
     foreach ($menus as $title => $menu) {
         if (array_key_exists('children', $menu) && $menu['children']) {
             foreach ($menu['children'] as $childTitle => $child) {
                 if (strripos(URL::current(), $child['uri'])) {
                     return $title;
                 }
             }
         } else {
             if (strripos(URL::current(), $menu['uri'])) {
                 return $title;
             }
         }
     }
 }
開發者ID:pfncfen,項目名稱:ForoneAdministrator,代碼行數:17,代碼來源:BaseController.php

示例11: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  \Closure  $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if ($this->auth->guest()) {
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             Session::put('pre_login_url', URL::current());
             return redirect()->guest('/login');
         }
     }
     if (!$request->user()->active) {
         $this->auth->logout();
         if ($request->ajax()) {
             return response('Unauthorized.', 401);
         } else {
             return redirect()->guest('/login');
         }
     }
     return $next($request);
 }
開發者ID:night70,項目名稱:sepehr,代碼行數:27,代碼來源:Authenticate.php

示例12: query

 /**
  * Get the query object to be processed by datatables.
  *
  * @return \Illuminate\Database\Query\Builder|\Illuminate\Database\Eloquent\Builder
  */
 public function query()
 {
     $url = explode("/", URL::current());
     $assets = FileAsset::select()->where('category', $url[6]);
     return $this->applyScopes($assets);
 }
開發者ID:yajra,項目名稱:cms-core,代碼行數:11,代碼來源:FileAssetsDataTable.php

示例13: doEditNode

 public function doEditNode()
 {
     $model = $this->model;
     $idNode = Input::get('id');
     $current = $model::find($idNode);
     $templates = Config::get('jarboe::tree.templates');
     $template = Config::get('jarboe::tree.default');
     if (isset($templates[$current->template])) {
         $template = $templates[$current->template];
     }
     $options = array('url' => URL::current(), 'def_name' => 'tree.' . $template['node_definition'], 'additional' => array('node' => $idNode, 'current' => $current));
     $controller = new JarboeController($options);
     $result = $controller->query->updateRow(Input::all());
     $model::flushCache();
     $item = $model::find($idNode);
     $result['html'] = View::make('admin::tree.content_row', compact('item'))->render();
     // log action
     if (\Config::get('jarboe::log.enabled')) {
         $this->event->setAction(Event::ACTION_UPDATE);
         $this->event->setEntityTable($item->getTable());
         $this->event->setEntityId($item->id);
         $this->notifyObserver();
     }
     return Response::json($result);
 }
開發者ID:OlesKashchenko,項目名稱:Jarboe,代碼行數:25,代碼來源:TreeCatalogController.php

示例14: isActive

/**
 * @param $url
 * @return null|string
 * Detect if current URL is active and add an "active" class
 */
function isActive($url)
{
    return URL::current() == URL::to($url) ? 'active' : null;
}
開發者ID:wearecolossal,項目名稱:nestlecafe,代碼行數:9,代碼來源:helpers.php

示例15: fromCurrentUrl

 /**
  * Generate form hash
  * @return string
  */
 private function fromCurrentUrl()
 {
     return $this->hash(URL::current());
 }
開發者ID:thytanium,項目名稱:captcha,代碼行數:8,代碼來源:Captcha.php


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