本文整理汇总了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;
}
示例2: current
public function current($uri = false)
{
if ($uri) {
return Request::url();
}
return Request::fullUrl();
}
示例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;
}
示例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');
}
示例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;
}
示例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'));
}
示例7: getCurrentUrl
/**
* Get the current request's route if available.
*
* @return string
*/
protected function getCurrentUrl()
{
if (App::runningInConsole()) {
return 'console';
}
return Request::fullUrl();
}
示例8: save
public static function save()
{
Session::put('rapyd.' . Request::path(), Request::fullUrl());
}
示例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;
}
}
示例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;
}
示例11: index
public function index()
{
$triggers = Auth::user()->triggers;
Session::flash('backTo', Request::fullUrl());
return view('trigger.index', compact('triggers'));
}
示例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);
}