CodeIgniter Forums
Update CI url_helper "current_url" Remove /Index - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forum-22.html)
+--- Thread: Update CI url_helper "current_url" Remove /Index (/thread-30549.html)



Update CI url_helper "current_url" Remove /Index - El Forum - 05-18-2010

[eluser]harman[/eluser]
Code:
if ( ! function_exists('current_url'))
{
    function current_url()
    {
        $CI =& get_instance();
        $removeIndex=str_replace("/".$CI->config->item('index_page'),"",$CI->config->site_url($CI->uri->uri_string()));
        return $removeIndex;
    }
}