Welcome Guest, Not a member yet? Register   Sign In
URL routing
#2

[eluser]gon[/eluser]
I think this can't be done 'cause CI will load the controller if it exists.

You can however put a _remap call into the main controller, that will receive all calls, with the article name passed as an argument. So you check if the article exists in the database. But as I just noted, I think this won't work if a controller exists with the same name.

Another way can be using hooks. Before the controller is loaded, you can "intercept" the arguments.

But I wouldn't do that unless it is absolutely neccesary.

Why don't have a controller named "article":

host.com/article/name

this would be even better for users to remember the URLs.

cheers.


Messages In This Thread
URL routing - by El Forum - 04-11-2008, 03:02 AM
URL routing - by El Forum - 04-11-2008, 06:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB