link_href Helper Function

I added a function called link_href to ../helpers/Functions.php and it allows me to link image buttons to item pages. Is there a better way to code this with one of the current functions or would this be something beneficial to add to the global Functions page?

Code in Functions.php:

function link_href($record, $action='show', $text) {
$path = $record->getPluralized() . DIRECTORY_SEPARATOR . $action . DIRECTORY_SEPARATOR . $record->id;
return '<a href="'. uri($path) . '">' . ($text) . '</a>';
}

Code on frontend:

<?php $orangebot = img('orange-btn.gif'); ?>
<?php echo link_href($featuredItem,show,"<img src=$orangebot border='0' >"); ?>

You can see the theme that I am developing here: http://euclidcorridor.dreamhosters.com/

Yes, there is already a link_to() function that does what your function does for most cases. You can't use it for inserting HTML into the , so there will probably be a link_to_img() helper that does something similar to what yours does. I would imagine that it would be something like: link_to_img($featuredItem, 'show', 'orange-btn.gif');. By the way, nice job on the that theme, it looks great!

Yes, there is already a link_to() function that does what your function does for most cases. You can't use it for inserting HTML into the tag, so there will probably be a link_to_img() helper that does something similar to what yours does. I would imagine that it would be something like: link_to_img($featuredItem, 'show', 'orange-btn.gif');. By the way, nice job on the that theme, it looks great!