Welcome Guest, Not a member yet? Register   Sign In
SVN url helper : current_url function added
#5

[eluser]xwero[/eluser]
Lately i'm discovering the current_url function is too inflexible to use, even with my modification, in forms that use segments to specify extra content. So i came up with this modification
Code:
function current_url($uri = '',$segments = 0)
{
    if($uri != ''){ $uri = '/'.$uri; }
    $CI =& get_instance();
    $uri_string = $CI->uri->uri_string();
    if($segments > 0){ $uri_string = implode('/',array_slice($CI->uri->segment_array(),0,$segments)); }
    return $CI->config->site_url($uri_string.$uri);
}


Messages In This Thread
SVN url helper : current_url function added - by El Forum - 08-20-2008, 02:24 AM
SVN url helper : current_url function added - by El Forum - 08-20-2008, 05:28 AM
SVN url helper : current_url function added - by El Forum - 08-20-2008, 08:09 AM
SVN url helper : current_url function added - by El Forum - 08-26-2008, 03:58 AM
SVN url helper : current_url function added - by El Forum - 09-17-2008, 04:09 AM
SVN url helper : current_url function added - by El Forum - 09-17-2008, 04:45 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 02:37 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 03:18 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 03:28 AM
SVN url helper : current_url function added - by El Forum - 09-18-2008, 10:37 PM
SVN url helper : current_url function added - by El Forum - 09-19-2008, 12:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB