Skip to content

Instantly share code, notes, and snippets.

@hamadu
Created November 8, 2011 10:51
Show Gist options
  • Save hamadu/1347487 to your computer and use it in GitHub Desktop.
Save hamadu/1347487 to your computer and use it in GitHub Desktop.
何故作った
function uni_html_link($name, $module = '', $action = '', $param = array(), $class = ''){
$str = $module . '/' . $action;
if (count($param) > 0) {
$str .= '?';
foreach ($param as $key => $value) {
$str .= $key . '=' . $value . '&';
}
$str = substr($str, 0, -1);
}
$url = url_for($str);
return sprintf('<a class="%s" href="%s">%s</a>', $class, $url, $name);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment