Poll: Improved routing?
This poll is closed.
yes
82.98%
39 82.98%
no
8.51%
4 8.51%
maybe
8.51%
4 8.51%
Total 47 vote(s) 100%
* You voted for this item. [Show Results]

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Magic Routing toggle

#1
I suggested this in another thread but will repost here as it is where it should go. Narf also said he already has something in mind for 4.0.

I suggested having a toggle in the config that defaulted to "on" for codeigniter's automatic routing to controllers. By having it default to "on", it will not break backwards compatibility. By turning it "off" it will allow developers to have much more control of how urls will work in their app.
Reply

#2
Absolutly agree. We have to create routes manually.
Automatic segment based routing is very bad practise make debugging harder.
With a well structured routes file you get a clear overview of the application's actions.
Reply

#3
(04-07-2015, 04:39 AM)orionstar Wrote: Automatic segment based routing is very bad practise make debugging harder.

What? It can't be easier to debug!

I'm not against the ability to configure your own route manually. But how can it be hard to debug something as simple as that? I think manual routing will lead to a lot of headache when trying to understand why it's not working the way you want to.
Test your translation files with Translation Tester
Reply

#4
I would also like to see reverse routing
Reply

#5
(04-07-2015, 05:50 PM)includebeer Wrote:
(04-07-2015, 04:39 AM)orionstar Wrote: Automatic segment based routing is very bad practise make debugging harder.

What? It can't be easier to debug!

I'm not against the ability to configure your own route manually. But how can it be hard to debug something as simple as that? I think manual routing will lead to a lot of headache when trying to understand why it's not working the way you want to.

Let's say you're creating your own routes for all your endpoints with custom urls. That means that every endpoint you create will end up having 2 urls, the one in your routes file and the one that automatically links to your controller. As systems grow, urls change, it can quickly become an issue where you don't know which endpoints are open and which ones are closed.

Regardless, it is better practice to have your own routes written out. Not only does it give you more control over the endpoints of your application, if you work in a team of developers, it also gives a 'map' of how every endpoint is directed.
Reply

#6
i am not against it, and fine with the feature supported. So long as i am not forced to use it.
"I reject your reality and substitute my own" - Adam Savage, M5 Inc.
Reply

#7
(04-09-2015, 02:04 PM)Hobbes Wrote: i am not against it, and fine with the feature supported. So long as i am not forced to use it.

Yep ! +1
Test your translation files with Translation Tester
Reply

#8
With my personal experience I vote for full remove-al of auto route matching /controller/method

Usually it is good to have controller name + method matching the required url path.
But this is not possible always and some times you can have duplicated content because you have some custom router which is accessable at its default Controller/method path..
And you know what SEO thinks for duplicated content...
Best VPS Hosting : Digital Ocean
Reply

#9
(04-12-2015, 05:26 AM)sv3tli0 Wrote: With my personal experience I vote for full remove-al of auto route matching /controller/method

Why does it bother you if it's still available but can be turned off?
Test your translation files with Translation Tester
Reply

#10
(04-12-2015, 09:44 AM)includebeer Wrote:
(04-12-2015, 05:26 AM)sv3tli0 Wrote: With my personal experience I vote for full remove-al of auto route matching /controller/method

Why does it bother you if it's still available but can be turned off?

Look this comment in "Modules support?" topic, it also suggests turning off a feature http://forum.codeigniter.com/thread-6128...#pid316340

So far, if we go the way of turning off key features by configuration we will end up with four different CodeIgniters. If I write code that I want to contribute publicly, for which of them should I write it? Also, testing and supporting de-facto four for now different CodeIgniters would be hard.

"Convetion over configuration" would be a better  approach. We have to reach agreements without inventing new configuration options so easily.
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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