Reputation: 54949
I am building a cakephp app - its a food recommendation service. and i would like to have mobile views for that.
i just wanted to know of the best practise on how it can be done.
Problem is i will have to feed mobile views and city also
i wil have few cities which
so to address a City 1
its will be either city1.website.com or website.com/city
now i wanna have mobile views with this too. so
it has to either be m.site.com or site.com/m/
so how is it done the best way. and how to code it in cakephp ?
Upvotes: 1
Views: 2919
Reputation: 1689
You might want to look at this question and my answer. It might be just what you need.
CakePHP website mobile version
Upvotes: 1
Reputation: 991
There is a great tutorial for Cake 1.2 here that should not be too difficult to port over:
http://madething.org/post/661607317/mobile-browser-detection-and-optimization-in-cakephp
Basically you detect the mobile device within beforeFilter(); and use this to serve mobile optimized layouts.
Upvotes: 2