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
#21

I am already doing something similar to this in CI3. Essentially I'm using the "default controller/method" (accessible in index.php around line 158) to circumvent the routing system all together. Then from my default Controller/method I simply invoke whatever routing tool I want to use. It works really well when combined with Composers autoload classmap (to map the controllers) and CodeIgniters packages utility.
Reply
#22

(04-15-2015, 10:23 PM)sv3tli0 Wrote:
(04-15-2015, 04:30 PM)includebeer Wrote:
(04-13-2015, 11:55 PM)sv3tli0 Wrote: Backwards Compatibility is pointless thing to watch on..
We are discussing namespaces, need of rebuilding the core of CI, and Backwards Compatibility will be not possible at all..

Backward compatibility is never pointless. It doesn't matter if the core is completely rewritten from scratch. It can still be somewhat compatible without requiring us to rewrite our applications. Your quest for the bleeding edge PHP programming is not worth the time it will all takes us to rewrite everything. What's the point in using a framework if it can back-stab me anytime and render all my previous work worthless. Maybe Laravel is better for you. Dodgy

I don't say that ci4 should have no BC.. But CI needs some power. If we focus on keeping maximum BC you will have result as IE 10 .. New which is already old ..

This is major release until it there will be CI 3 versions perhaps 3.1 /  3.2 ..
You are can to keep your apps on CI 3 no body is forcing anyone to upgrade..

BTW I am using CI, Laravel and Symfony and I will be very happy if CI 4 will be the one in my future projects as its hard to know all small tricks and details of 3 frameworks at once.. 

You may not have said it should have no BC, but you did say that BC "is pointless thing to watch on"... IE is an interesting point for illustration:
1) IE will be included in at least some versions of Windows 10 for backwards compatibility
2) IE and the new browser will share rendering engines, making the new browser backwards compatible with all of the crusty old non-standard HTML, CSS, and JavaScript that people complain about so much.
3) The compatibility break in the new browser is with the plugin functionality of IE, so the break is limited in the number of impacted users, developers, and sites, especially since most of the widely-used plugins have already been rewritten for the new browser or most of the sites which used them were rewritten to not use them around the time it became popular to make your sites work on mobile browsers.

The idea that no one is forced to upgrade is simply not based on reality. I'm currently in the process of upgrading my site to CI 3 because CI 2 will no longer receive security updates after October. Even with a significant amount of backwards compatibility between CI 2 and 3, I'm still looking at a significant amount of work in some portions of my website. If CI 3 has continued security updates for less than a year after the release of CI 4, and the backwards compatibility break is more significant than that between CI 2 and 3, I would really consider just moving to something else. In fact, if I didn't feel that there was at least a possibility that CI 4 would have some level of backwards compatibility, I would be looking at starting that process now rather than spending so much time trying to get my site ported over to CI 3.
Reply
#23

The controller/method system has been a really limiting pain for me recently and setting routes manually seems like a really exciting idea. I really hope that gets implemented in CI4.

As for BC, if it can be done to add a toggle to turn back on the method controller routing, then that is fine, but it should be off by default and if it cannot be done, so be it. Along with sv3tli0 and skunkbad, I think BC should be the afterthought, not the driving factor. Besides, I like the idea of all the extra billing from rewriting old apps :-)
Reply
#24

I think routing like Phalcon is better.
https://docs.phalconphp.com/en/latest/re...uting.html

It can define all routes and has the default "/:controller/:action/:params".
https://docs.phalconphp.com/en/latest/re...t-behavior

If you want controller/method system, you don't have to do nothing.
If you don't want controller/method system, you set router not to use it.
Reply
#25

(07-11-2015, 06:39 PM)PaulD Wrote: The controller/method system has been a really limiting pain for me recently and setting routes manually seems like a really exciting idea. I really hope that gets implemented in CI4.

So, set your routes manually. Really, the only thing disabling magic routing would do is prevent routes from being created for you automatically. Regardless of whether this is ever implemented, you can still manually create and block routes in your config/routes.php file.


(07-11-2015, 06:39 PM)PaulD Wrote: As for BC, if it can be done to add a toggle to turn back on the method controller routing, then that is fine, but it should be off by default and if it cannot be done, so be it. Along with sv3tli0 and skunkbad, I think BC should be the afterthought, not the driving factor. Besides, I like the idea of all the extra billing from rewriting old apps :-)

Backwards compatibility rarely works (and always takes extra effort) if it is an afterthought. It usually works better and often takes less extra effort (or no extra effort) if it is considered a priority from the start. Configuring it to not do magic routing by default is a minor thing, easily handled with a quick mention in the upgrade notes. Rewriting the routing code so "magic" routing can't be done at all just seems like a waste of effort, since that code has already been written and well-tested.

Even if I could make some extra money from rewriting old apps, I hate doing busy-work, which is one of the reasons I became a developer in the first place. I'd probably forward-port the "magic" routing code rather than write out 130+ routes that just map a URI segment to a controller of the same name. I renamed all of my controller files to go from CI2 to CI3, but I didn't do it by hand...

It usually takes less effort to consider backwards compatibility up front than to bolt it on as an afterthought. Plus the code is already working and fairly well-tested, so why re-write the code to remove a feature when all someone asked for was the ability to disable it?

Besides, even with an upgrade that has perfect backwards compatibility, it's pretty likely that most customers would want a developer familiar with the code base to oversee the upgrade. I'd rather have a short, easy job that goes smoothly for everyone than have my customer/employer and myself pulling our hair out because someone decided it was better to hard-code every route than do a simple file lookup based on an easy-to-predict pattern.
Reply
#26

LOL - Over a year later I finally saw this comment, following up on some query on stack overflow.

Reading my comments from just over a year ago makes me really appreciate how fast we change and grow as developers. You are absolutely right in everything you said here.

I especially liked your comment about busy work. I hate it too. In fact I got so fed up with the same conversations with customers over and over again that I stopped being self employed and am now part of a small team, which has been a real eye opener.

I am a bit of a designer and a bit of a developer, which of course means I am not by any means expert in either. I have worked with amazing designers, that produce extraordinarily inspiring work, and have seen the sort of code that expert developers write, which in a lot of way is like great poetry. I am proud to do a bit of both, but only do so on the shoulders of giants. CI is one of my giants. Really looking forward to the release of CI4, and more than likely learning lots of new stuff a more formally trained developer might take for granted.

Basically my view now is that whatever the CI development team want to do will be the right thing. And if I can't see it, it is because of my lack of experience or knowledge, not because it is the wrong decision. Although I do enjoy voicing an opinion, I am well aware that my opinion is limited in value :-(

Sorry to resurrect such an old thread, but was surprised I had missed your reply.

Paul.
Reply
#27

PaulD,
The CI devs are gifted and have written some great code, but always question the man Wink.
Codeigniter is simply one of the tools you need to learn to be a successful developer. Always add more tools to your coding arsenal!
Reply
#28

LOL. Indeed.

I can see the crowds gathering on the street right now. "What do we want - Authentication. When do we want it - Now".

Just preparing my banner as I speak - "Authentication is a right, not a privilege". Might even get to loot some shops while we are marching for peace and good of all mankind too! :-)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB