• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CodeIgniter Routing works on MAMP NOT LAMP

#21
[eluser]Tim Brownlaw[/eluser]
[quote author="Narf" date="1413806495"]
...
Tim Brownlaw's advice is apparently based on CI3-dev, which changes how routing works quite a bit. For CI2 use all lowercase.[/quote]

@Narf - I was using 2.2.0... The interesting thing was with a single route ie Home, case didn't appear to matter so Home or home worked. But case did matter for say home/products. Which made you half right as you stated! Something I didn't expect and I've not dug into the code to see why! So it's just pure observation!

@andyscraven - It seems you've got it all under control now Smile


#22
[eluser]Narf[/eluser]
Quote:I did read the docs for C12 and if you look under the Controllers section they do use an example of “blog,” which is lowercase but they do not state that it must be lowercase.

CI 2, not 12. Smile
I'm quite certain that it's written *somewhere* that controller *filenames* must be written in lowercase.

Quote:In contrast they do however state further down that the Controller itself must start with Uppercase.

That's for *class* names, which don't really matter.

file name != class name
route != class name

It can be confusing though, indeed. Hence the changes in CI3.

Quote:The other issue is that I did not know that MAMP ignores case, very annoying, so could not reproduce it locally. Just downloaded Virtual Machine, so that does not happen again.

It's not MAMP or WAMP that ignores the case, it's the file system. A LAMP setup using files on NTFS also wouldn't make a difference. As far as I know, OSX can be configured (at installation time) to have a case-sensitive file system, so that's not entirely true about MAMP as well.

Quote:Is it worth upgrading to C13? Or should I research that myself grin

It's CI 3, not 13.
And yes, totally worth it.

Quote:I was using 2.2.0… The interesting thing was with a single route ie Home, case didn’t appear to matter so Home or home worked. But case did matter for say home/products. Which made you half right as you stated! Something I didn’t expect and I’ve not dug into the code to see why! So it’s just pure observation!

See ... that's the thing. It doesn't matter in general, but it appears to matter for default_controller and 404_override. Had anyscraven looked more carefully at the error message, he'd know that there's nothing wrong with his 'products/whatever' route, the message talks about a default route.

#23
[eluser]andyscraven[/eluser]
Quote:See ... that's the thing. It doesn't matter in general, but it appears to matter for default_controller and 404_override. Had anyscraven looked more carefully at the error message, he'd know that there's nothing wrong with his 'products/whatever' route, the message talks about a default route.

Infamy, Infamy! Narf's got it in for me!!!!! :-)

Andy
PS: You might have to be British to get that reference!!! :-)

#24
[eluser]Tim Brownlaw[/eluser]
[quote author="andyscraven" date="1413808788"]
...
Infamy, Infamy! Narf's got it in for me!!!!! :-)

Andy
PS: You might have to be British to get that reference!!! :-)[/quote]

Well depends where they show the "Carry On" movies...

So Andy, is it all working now?

#25
[eluser]andyscraven[/eluser]
[quote author="Tim Brownlaw" date="1413848633"]
Well depends where they show the "Carry On" movies...

So Andy, is it all working now?[/quote]

Ha ha!! Well done. I grew up with them.

I am creating a snapshot of one of my Digital Ocean Droplets today so I can test it safely.

#26
[eluser]andyscraven[/eluser]
Hi Tim,

So I got it working on my test server.

Not only did I have to rename the controllers to lower case but also all references to them in routes.php.

Thanks for all your help.

And yours Narf!

Andy


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


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