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:
Joey Trapp 2011-04-04 15:11:47 -05:00 committed by mark_story
parent 011aeae951
commit 3675e73c73
2 changed files with 15 additions and 2 deletions

View file

@ -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);
}
/**