I have adapted the URI Language Identifier to support cookies (for returning visitors), and auto determination of the starting language, depending on browser language and/or GeoIP. If you’re interested PM me.
Notice how ‘en’ appears 2 times on current_url() giving an incorrect url. I think it is because internally current_url is calculated by calling site_url(uri_string()) and as the ‘en’ appear in both they are duplicated. Shouldn’t uri_string() return the string without the language prefix? Or as another alternative have site_url() return without the prefix and let uri_string() return it? Don’t know which would be the most elegant solution.
See in the user guide at http://codeigniter.com/user_guide/general/helpers.html
You need do extending the uri helper and add a current_uri function: in this function ignore the first segment…. Set (but i have not try)
function current_url() { $CI =& get_instance(); return $CI->config->base_url($CI->uri->uri_string()); }
So no further responses here? Has this script never worked. I basically used it on a clean install and without modifying common system functions and it is pretty useless. I don’t like the idea of extending the uri helper to ignore the first segment because sometimes there is no language set in the uri and removing the first segment will cause the system to break.
Notice how ‘en’ appears 2 times on current_url() giving an incorrect url. I think it is because internally current_url is calculated by calling site_url(uri_string()) and as the ‘en’ appear in both they are duplicated. Shouldn’t uri_string() return the string without the language prefix? Or as another alternative have site_url() return without the prefix and let uri_string() return it? Don’t know which would be the most elegant solution.
Thanks in advance
M.
I have same problem :-( Please help how i can fix it….
I Use this library extension but I have a problem. When someone mistype his URL into something like http://domain.com/controlelr (with a error), I don’t get a 404 but a A PHP Error in this library because the controller was not found.
Is there a solution to throw a 404 page when the controller was not found?