mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-09 04:52:42 +00:00
Added a flag to Router::reverse that is passed on to the Router::url call
Fixes #1638 Signed-off-by: mark_story <mark@mark-story.com>
This commit is contained in:
parent
011aeae951
commit
3675e73c73
2 changed files with 15 additions and 2 deletions
|
@ -1013,9 +1013,11 @@ class Router {
|
|||
* are used for CakePHP internals and should not normally be part of an output url.
|
||||
*
|
||||
* @param mixed $param The params array or CakeRequest object that needs to be reversed.
|
||||
* @param boolean $full Set to true to include the full url including the protocol when reversing
|
||||
* the url.
|
||||
* @return string The string that is the reversed result of the array
|
||||
*/
|
||||
public static function reverse($params) {
|
||||
public static function reverse($params, $full = false) {
|
||||
if ($params instanceof CakeRequest) {
|
||||
$url = $params->query;
|
||||
$params = $params->params;
|
||||
|
@ -1033,7 +1035,7 @@ class Router {
|
|||
if (!empty($url)) {
|
||||
$params['?'] = $url;
|
||||
}
|
||||
return Router::url($params);
|
||||
return Router::url($params, $full);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue