url helper: anchor() with array param losing first assoc key? |
[eluser]Dennis Rasmussen[/eluser]
That's because uri_to_assoc converts your URI to an array looking like this: Code: $array = ( And when you pass that into anchor (which then sends it to site_url as it's an array) it will only use the keys of the array ('testsite', 'about') giving you the result: test_link = http://localhost/testsite/about (broken) --- Is there any specific reason as to why you're using uri_to_assoc? If you want to split your URI into an array to be able to edit the array/URI then you have to convert it back into an URI from assoc (as you do in the 2nd example). |
Messages In This Thread |
url helper: anchor() with array param losing first assoc key? - by El Forum - 10-12-2010, 06:34 AM
url helper: anchor() with array param losing first assoc key? - by El Forum - 10-12-2010, 06:52 AM
url helper: anchor() with array param losing first assoc key? - by El Forum - 10-12-2010, 06:52 AM
url helper: anchor() with array param losing first assoc key? - by El Forum - 10-12-2010, 07:36 AM
url helper: anchor() with array param losing first assoc key? - by El Forum - 10-12-2010, 08:21 AM
|