Welcome Guest, Not a member yet? Register   Sign In
Codeigniter development (v3.0)
#11

[eluser]Narf[/eluser]
Code:
php > echo preg_replace('#^(.*)-(.*)/(.*)-(.*)$#', '$1_$2/$3_$4', 'controller/method/param-1/param-2');
controller/method/param_1/param_2

php > echo preg_replace('#^(.*)/(.*)-(.*)$#', '$1/$2_$3', 'controller/method/param-1/param-2');
controller/method/param-1/param_2

php > echo preg_replace('#^(.*)-(.*)$#', '$1_$2', 'controller/method/param-1/param-2');
controller/method/param-1/param_2
#12

[eluser]wiredesignz[/eluser]
@Narf, Your controller should be able to manage the segments 3 & 4 perfectly well if that case arises.

@Narf, additionally, with your little hack there are now four URL's that will respond with the same controller/method call and page output which is not very friendly in terms of SEO.

Code:
cont-roller/met-hod == cont_roller/met_hod
cont-roller/met_hod == cont_roller/met_hod
cont_roller/met-hod == cont_roller/met_hod
cont_roller/met_hod
#13

[eluser]Narf[/eluser]
Why and how should my controller be able to manage segments 3 and 4 which get broken by your routing rules?

I was just trying to show what Aken was trying to explain, but it's obvious that you're just refusing to accept that change. Let it go.
#14

[eluser]wiredesignz[/eluser]
@Narf, You're in no position to tell anyone to let anything go.
I would accept any change that I see will benefit the majority of developers, I won't accept poorly thought out alterations to suit one or two people with ego greater than their ability. Just because you have access to the CI repo doesn't mean you should alter the core as if it were some school project.
EDIT:
I recommend you go back and review your hack of the router based on the issue of multiple URL's resolving to the same controller/method that I have mentioned above.
#15

[eluser]Narf[/eluser]
... and you talk about egos. Smile

I just don't know how to comment on such a bold statement.
#16

[eluser]wiredesignz[/eluser]
@Narf, Ego, is having control of the CI repository and not respecting it by adding silly little alterations that suit nobody but yourself.
EDIT:
You still have not mentioned the multiple URL issue I raised.
#17

[eluser]Narf[/eluser]
Ego, is talking down to people like you're their boss when you're not.
Ego, is assuming there's no right opinion other than yours.
Ego, is trying to tell people what to do.
Ego, is giving erroneous code suggestions and not admitting it when proven wrong.
Ego, is having 3 people arguing with you and still trying to demand reversal of an already accepted change.

Ego, is NOT implementing a user-requested feature that I myself don't and wouldn't use.
It's easy to target the "power people", but at least do your homework and don't try to hide behind false accusations.

And ego is also claiming that a feature is actually a bug, because you don't like it. AFAIK, a web spider will not magically know your method names - it has to read them from a webpage. If you create dashed links - it will look at them, if not - it won't. If you create both types of links - then it's your fault.
#18

[eluser]wiredesignz[/eluser]
If a referring site uses underscores instead of hyphens the 'spider' will follow that link to a valid page with an incorrect URL. It will most likely be indexed that way.
#19

[eluser]CroNiX[/eluser]
Why would a referring site use an underscore if the link on the site uses a dash? I can see that being a problem if a site originally used underscores in links and search engines/referring sites cataloged the link that way and then the site later converted to dashes. But if the links on the original site had dashes from the get-go, where would a referring site get underscores from?

If a site did convert their url scheme at some point, shouldn't they be responsible for creating htaccess rewrite rules for dealing with that before the code hits CI?
#20

[eluser]wiredesignz[/eluser]
@CroNiX, Yes but the issue is the developer will be aware of this if he makes the changes. It is under his control and his responsibility.

But with @Narf's changes the routing change is automatic. The developer has no choice. Everything will still work.

EDIT:
Changing an URL from underscores to hyphens should cause the application fail under normal circumstances and require the developer to review his code. In this case it will not.




Theme © iAndrew 2016 - Forum software by © MyBB