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