Welcome Guest, Not a member yet? Register   Sign In
Poll: Improved routing?
You do not have permission to vote in this poll.
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]

Magic Routing toggle
#1

(This post was last modified: 04-07-2015, 06:36 AM by ciadmin.)

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, 03: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.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#4

I would also like to see reverse routing
Reply
#5

(04-07-2015, 04:50 PM)includebeer Wrote:
(04-07-2015, 03: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, 01: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
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
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, 04: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?
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply
#10

(04-12-2015, 08:44 AM)includebeer Wrote:
(04-12-2015, 04: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




Theme © iAndrew 2016 - Forum software by © MyBB