mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-20 19:35:16 +00:00
Add method that makes sure that URL's are expanded for page navigation/
This commit is contained in:
@@ -61,6 +61,32 @@ class Controller extends BaseController
|
|||||||
$this->parameters = $this->getParameters();
|
$this->parameters = $this->getParameters();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
protected function buildParams(): string
|
||||||
|
{
|
||||||
|
$return = '?';
|
||||||
|
$params = [];
|
||||||
|
foreach ($this->parameters as $key => $value) {
|
||||||
|
if($key === 'page') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if ($value instanceof Carbon) {
|
||||||
|
$params[$key] = $value->format('Y-m-d');
|
||||||
|
}
|
||||||
|
if (!$value instanceof Carbon) {
|
||||||
|
$params[$key] = $value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$return .= http_build_query($params);
|
||||||
|
if (strlen($return) === 1) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return $return;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return ParameterBag
|
* @return ParameterBag
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user