Skip to content

Commit

Permalink
Makes link_to family discard current route params.
Browse files Browse the repository at this point in the history
Fix #96.
(cherry picked from commit ae3d52f)
  • Loading branch information
zerocrates committed Sep 26, 2011
1 parent ddc630c commit 9df31da
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions application/helpers/LinkFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function link_to($record, $action=null, $text='View', $props = array(), $queryPa
$route = 'default';
$urlOptions['controller'] = (string) $record;
if($action) $urlOptions['action'] = (string) $action;
$url = uri($urlOptions, $route, $queryParams);
$url = uri($urlOptions, $route, $queryParams, true);
}


Expand Down Expand Up @@ -78,9 +78,7 @@ function link_to_advanced_search($text = 'Advanced Search', $props = array(), $u
**/
function link_to_browse_items($text, $browseParams = array(), $linkProperties = array())
{
// Set the link href to the items/browse page.
$linkProperties['href'] = uri(array('controller'=>'items', 'action'=>'browse'), 'default', $browseParams);
return "<a " . _tag_attributes($linkProperties) . ">$text</a>";
return link_to('items', 'browse', $text, $linkProperties, $browseParams);
}

/**
Expand Down

0 comments on commit 9df31da

Please sign in to comment.