Welcome Guest, Not a member yet? Register   Sign In
Feature Request: Routing
#1

This is a feature request for whichever is the next iteration of CI, whether it be 3.1 or 4.0, and since there isn't a dedicated page for it I'll post it here.

Initially I was a big fan of the "magic" routing in Codeigniter as it made it easy to just create a controller and get going. But as time went on and hundreds of controllers have been created, I've had to do a lot of routing so specific urls go to the right location (example: "/profile/1/show");

The issue with this is that by doing it this way, you have 2 open endpoints to the same location in your app. So if I have

Controller: Comments
Method: show($id)
Route: "/comments/(:num)/show" = "comments/show/$1"

I can actually hit this same method by going to both /comments/1/show and comments/show/1.

As you can imagine, this might cause an issue down the road if you have endless API endpoints and so forth.

My Proposal:


I propose there be a simple toggle in your config file for the automatic routing. By having it default to "On", it will prevent any breaking changes to previous versions of codeigniter, and by turning it "Off" we give the developer the choice of having to write their own routes.
Reply


Messages In This Thread
Feature Request: Routing - by albertleao - 02-12-2015, 02:10 PM
RE: Feature Request: Routing - by CroNiX - 02-12-2015, 03:43 PM
RE: Feature Request: Routing - by albertleao - 02-12-2015, 04:01 PM
RE: Feature Request: Routing - by albertleao - 02-12-2015, 04:24 PM
RE: Feature Request: Routing - by CroNiX - 02-12-2015, 04:35 PM
RE: Feature Request: Routing - by albertleao - 02-12-2015, 04:39 PM
RE: Feature Request: Routing - by paralogizing - 02-12-2015, 08:03 PM
RE: Feature Request: Routing - by albertleao - 02-12-2015, 08:09 PM
RE: Feature Request: Routing - by Narf - 02-13-2015, 03:58 AM
RE: Feature Request: Routing - by albertleao - 02-13-2015, 05:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB