Welcome Guest, Not a member yet? Register   Sign In
html_helper link_tag() 6th parameter
#1

[eluser]skunkbad[/eluser]
From what I understand, the 6th parameter of link_tag() should build the link with either a relative link, or an absolute link, depending on if TRUE or FALSE. In it's current state, the link_tag function will always prepend the value of the href with the base_url.

Lines 302 through 309 (if $href is an array):
Code:
if ($index_page === TRUE)
{
    $link .= ' href="'.$CI->config->site_url($v).'" ';
}
else
{
    $link .= ' href="'.$CI->config->slash_item('base_url').$v.'" ';
}

Lines 325 through 332 (if $href is not an array):

Code:
elseif ($index_page === TRUE)
{
    $link .= ' href="'.$CI->config->site_url($href).'" ';
}
else
{
    $link .= ' href="'.$CI->config->slash_item('base_url').$href.'" ';
}

Am I right?

If I am right, both lines 308 and 331 should be changed:
Code:
// Line 308
$link .= ' href="'.$v.'" ';
Code:
// Line 331
$link .= ' href="'.$href.'" ';


Messages In This Thread
html_helper link_tag() 6th parameter - by El Forum - 10-09-2009, 08:55 PM
html_helper link_tag() 6th parameter - by El Forum - 10-14-2009, 05:55 PM



Theme © iAndrew 2016 - Forum software by © MyBB