• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL routing

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":


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


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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.