Welcome Guest, Not a member yet? Register   Sign In
Routes and uri_to_assoc
#1

[eluser]csernik.marton[/eluser]
Hi!

I have a controller named Fontface, with an index function, in which I am taking the parameter family from the URI and according to it's value, I'm doing a few things, so to wrap up, the URI looks like this:

Code:
/fontface/index/family/something

Doing an uri_to_assoc(), I get the expected array:

Code:
Array
(
    [family] => something
)

I was thinking about adding a route (config/routes.php) like this to make it prettier:

Code:
$route['fontface/(:any)'] = 'fontface/index/family/$1';

...and changing the URI to:

Code:
/fontface/something

But after these steps the uri_to_assoc() is giving me an empty array.

Is it a bug or am I doing wrong something? I am working on Win7, WAMP (PHP 5.2.6, Apache 2.2.8) and using CI 2.0.3.

Thanks for the ideas.
#2

[eluser]Unknown[/eluser]
Been a while but the answer is here: http://stackoverflow.com/questions/11854...er-routing




Theme © iAndrew 2016 - Forum software by © MyBB