Welcome Guest, Not a member yet? Register   Sign In
url helper: anchor() with array param losing first assoc key?
#2

[eluser]Dennis Rasmussen[/eluser]
That's because uri_to_assoc converts your URI to an array looking like this:

Code:
$array = (
  'testsite' => 'welcome',
  'about' => false
);

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:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB