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


PHP Request::fullUrl方法代碼示例

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


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

示例1: getExceptionData

 private function getExceptionData($exception)
 {
     $data = [];
     $data['host'] = Request::server('HTTP_HOST');
     $data['method'] = Request::method();
     $data['fullUrl'] = Request::fullUrl();
     if (php_sapi_name() === 'cli') {
         $data['host'] = parse_url(config('app.url'), PHP_URL_HOST);
         $data['method'] = 'CLI';
     }
     $data['exception'] = $exception->getMessage();
     $data['error'] = $exception->getTraceAsString();
     $data['line'] = $exception->getLine();
     $data['file'] = $exception->getFile();
     $data['class'] = get_class($exception);
     $data['storage'] = array('SERVER' => Request::server(), 'GET' => Request::query(), 'POST' => $_POST, 'FILE' => Request::file(), 'OLD' => Request::hasSession() ? Request::old() : [], 'COOKIE' => Request::cookie(), 'SESSION' => Request::hasSession() ? Session::all() : [], 'HEADERS' => Request::header());
     $data['storage'] = array_filter($data['storage']);
     $count = $this->config['count'];
     $data['exegutor'] = [];
     $data['file_lines'] = [];
     $file = new SplFileObject($data['file']);
     for ($i = -1 * abs($count); $i <= abs($count); $i++) {
         list($line, $exegutorLine) = $this->getLineInfo($file, $data['line'], $i);
         $data['exegutor'][] = $exegutorLine;
         $data['file_lines'][$data['line'] + $i] = $line;
     }
     // to make Symfony exception more readable
     if ($data['class'] == 'Symfony\\Component\\Debug\\Exception\\FatalErrorException') {
         preg_match("~^(.+)' in ~", $data['exception'], $matches);
         if (isset($matches[1])) {
             $data['exception'] = $matches[1];
         }
     }
     return $data;
 }
開發者ID:Cherry-Pie,項目名稱:LogEnvelope,代碼行數:35,代碼來源:LogEnvelope.php

示例2: current

 public function current($uri = false)
 {
     if ($uri) {
         return Request::url();
     }
     return Request::fullUrl();
 }
開發者ID:parabol,項目名稱:laravel-cms,代碼行數:7,代碼來源:Url.php

示例3: active

 public function active($parent = false)
 {
     $path = substr(Request::fullUrl(), strlen(url('/')) + 1);
     if ($parent) {
         $p = explode('/', $path);
         return !empty($p[0]) && $p[0] == $this->path;
     }
     return $this->path == $path;
 }
開發者ID:ognestraz,項目名稱:laravel-model,代碼行數:9,代碼來源:Menu.php

示例4: create

 public function create()
 {
     // keep backtrack token in the session one more step of the way.
     if (Session::has('backTo')) {
         Session::keep('backTo');
     } else {
         Session::flash('backTo', Request::fullUrl());
     }
     return view('medicine.create');
 }
開發者ID:michaelkimball,項目名稱:MigraineTracker,代碼行數:10,代碼來源:MedicineController.php

示例5: link

 /**
  * @param string $url
  * @param string $name
  * @param string $position
  * @param array  $attributes
  *
  * @return $this
  */
 public function link($url, $name, $position = "BL", $attributes = array())
 {
     $base = str_replace(Request::path(), '', strtok(Request::fullUrl(), '?'));
     $match_url = str_replace($base, '/', strtok($url, '?'));
     if (Request::path() != $match_url) {
         $url = Persistence::get($match_url, parse_url($url, PHP_URL_QUERY));
     }
     $attributes = array_merge(array("class" => "btn btn-default"), $attributes);
     $this->button_container[$position][] = HTML::link($url, $name, $attributes);
     $this->links[] = $url;
     return $this;
 }
開發者ID:chellmann,項目名稱:rapyd-laravel,代碼行數:20,代碼來源:Widget.php

示例6: edit

 public function edit(Journal $journal)
 {
     // keep backtrack token in the session one more step of the way.
     if (Session::has('backTo')) {
         Session::keep('backTo');
     } else {
         Session::flash('backTo', Request::fullUrl());
     }
     $journal = $journal->load('triggers');
     // Create list with name=>id to use in select2 field.
     $triggers = Auth::user()->triggers()->lists('name', 'id');
     $medicines = Auth::user()->medicines()->lists('name', 'id');
     $common_triggers = CommonTriggers::all()->lists('name', 'id');
     //        $pain_locations = PainLocations::all()->lists('name', 'id');
     return view('journal.edit', compact('journal', 'common_triggers', 'triggers', 'medicines'));
 }
開發者ID:michaelkimball,項目名稱:MigraineTracker,代碼行數:16,代碼來源:JournalController.php

示例7: getCurrentUrl

 /**
  * Get the current request's route if available.
  *
  * @return string
  */
 protected function getCurrentUrl()
 {
     if (App::runningInConsole()) {
         return 'console';
     }
     return Request::fullUrl();
 }
開發者ID:owen-it,項目名稱:laravel-auditing,代碼行數:12,代碼來源:Auditable.php

示例8: save

 public static function save()
 {
     Session::put('rapyd.' . Request::path(), Request::fullUrl());
 }
開發者ID:chellmann,項目名稱:rapyd-laravel,代碼行數:4,代碼來源:Persistence.php

示例9: resetSaveIndexParameters

 /**
  * Reset or save index parameters
  *
  * @param string $module
  * @param array $possibleParameters
  * @return boolean
  */
 public static function resetSaveIndexParameters($module, $possibleParameters = ['search', 'orderbycolumn', 'orderbytype', 'relation'])
 {
     /**
      * Get common parameters
      */
     $allParameters = Request::all();
     /**
      * Parse existing parameters
      */
     foreach ($allParameters as $parameter => $value) {
         $cacheKey = implode('.', [$module, Auth::user()->id, $parameter]);
         /**
          * Reset
          */
         if (empty($value) == TRUE) {
             Cache::forget($cacheKey);
             unset($allParameters[$parameter]);
         } else {
             Cache::forever($cacheKey, $value);
         }
     }
     /**
      * Get new from cache
      */
     foreach ($possibleParameters as $parameter => $value) {
         $cacheKey = implode('.', [$module, Auth::user()->id, $value]);
         $allParameters[$value] = Cache::get($cacheKey);
     }
     /**
      * Sort parameters
      */
     ksort($allParameters);
     ksort($possibleParameters);
     /**
      * Redirect ?
      */
     $newRoute = trim(route($module . '.index', $allParameters), "?");
     $oldRoute = Request::fullUrl();
     /**
      * Routes are the same, everything is OK
      */
     if ($newRoute == $oldRoute) {
         return FALSE;
     } else {
         return $newRoute;
     }
 }
開發者ID:jdrda,項目名稱:olapus,代碼行數:54,代碼來源:Helpers.php

示例10: back

 /**
  * enable auto-back feature on given actions
  * @param  string $actions
  * @param  string $uri
  * @return $this
  */
 public function back($actions = 'insert|update|do_delete', $url = "")
 {
     if ($url == "") {
         if (count($this->links)) {
             $url = array_pop($this->links);
         } else {
             return $this;
         }
     } else {
         $base = str_replace(Request::path(), '', strtok(Request::fullUrl(), '?'));
         $match_url = str_replace($base, '/', strtok($url, '?'));
         if (Request::path() != $match_url) {
             $url = Persistence::get($match_url);
         }
     }
     $this->back_on = explode("|", $actions);
     $this->back_url = $url;
     return $this;
 }
開發者ID:chellmann,項目名稱:rapyd-laravel,代碼行數:25,代碼來源:DataEdit.php

示例11: index

 public function index()
 {
     $triggers = Auth::user()->triggers;
     Session::flash('backTo', Request::fullUrl());
     return view('trigger.index', compact('triggers'));
 }
開發者ID:michaelkimball,項目名稱:MigraineTracker,代碼行數:6,代碼來源:TriggerController.php

示例12: open

 /**
  * Overrides the base form open method to allow for automatic insertion of csrf tokens
  * and form class
  *
  * @param null   $action    Defaults to the current url
  * @param string $method    Defaults to POST
  * @param array  $attributes
  * @return string
  */
 public function open($action = null, $method = 'POST', $attributes = array())
 {
     // If an action has not been specified, use the current url
     $action = $action ?: Request::fullUrl();
     // Add in the form class if necessary
     if (empty($attributes['class'])) {
         $attributes['class'] = $this->getOption('formClass');
     } elseif (strpos($attributes['class'], 'form-') === false) {
         $attributes['class'] .= ' ' . $this->getOption('formClass');
     }
     // Auto-complete attribute
     if (empty($attributes['autocomplete'])) {
         $attributes['autocomplete'] = $this->getOption('autocomplete');
     }
     // Laravel's form builder uses a single array as a parameter
     $attributes['url'] = $action;
     $attributes['method'] = $method;
     return Form::open($attributes);
 }
開發者ID:jonob,項目名稱:formly,代碼行數:28,代碼來源:Formly.php


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