views:

34

answers:

2

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 ?

+1  A: 

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.

D Roddis
+1  A: 

You might want to look at this question and my answer. It might be just what you need.

http://stackoverflow.com/questions/3891310/cakephp-website-mobile-version

Dan Berlyoung
thanks a lot. since am including cities here. which is the best way to do it ?
Harsha M V