简体   繁体   中英

Cakephp app with mobile views

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 ?

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.

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

CakePHP website mobile version

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM