Skip to content
Permalink
Browse files

Added a flag to Router::reverse that is passed on to the Router::url …

…call
  • Loading branch information...
Joey Trapp
Joey Trapp committed Apr 4, 2011
1 parent fbab7bd commit 6a8322a2726c90c7d3e2c1d142deafa710ab2125
Showing with 13 additions and 2 deletions.
  1. +2 −2 cake/libs/router.php
  2. +11 −0 cake/tests/cases/libs/router.test.php
@@ -1060,7 +1060,7 @@ function queryString($q, $extra = array(), $escape = false) {
* @access public
* @static
*/
function reverse($params) {
function reverse($params, $full = false) {
$pass = $params['pass'];
$named = $params['named'];
$url = $params['url'];
@@ -1072,7 +1072,7 @@ function reverse($params) {
if (!empty($url)) {
$params['?'] = $url;
}
return Router::url($params);
return Router::url($params, $full);
}
/**
@@ -2147,6 +2147,17 @@ function testRouterReverse() {
);
$result = Router::reverse($params);
$this->assertEqual($result, '/eng/posts/view/1?foo=bar&baz=quu');
$params = array(
'lang' => 'eng',
'controller' => 'posts',
'action' => 'view',
'pass' => array(1),
'named' => array(),
'url' => array('url' => 'eng/posts/view/1')
);
$result = Router::reverse($params, true);
$this->assertPattern('/^http(s)?:\/\//', $result);
}
}

0 comments on commit 6a8322a

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.