Zach Kauffman
Zach Kauffman

Reputation: 496

Using PHP framework to display mobile vs desktop websites

Out of curiosity, is it possible to use MVC (PHP, proprietary framework) to display mobile sites to mobile users and desktop sites to desktop users by rendering different pages?

For example, if I detect mobile devices in PHP and use my controller to render mobile.home.php instead of desktop.home.php, is this bad programming practice? I've attempted to design responsive sites with media queries but I'm not much of a design guy.

What's wrong with this implementation?

Upvotes: 0

Views: 302

Answers (2)

FahadAkram
FahadAkram

Reputation: 465

If you use YIi2 framework with builtin bootstrap3 support it make your site responsive on all devices and using jquery mobile detection you are able to render your action on return result after mobile detection http://www.sitepoint.com/detect-mobile-devices-jquery/ http://forum.jquery.com/topic/jquery-mobile-device-detection What is the best way to detect a mobile device in jQuery?

Upvotes: 0

stack
stack

Reputation: 262

Perhaps, Adaptive Rendering can help you.

Read here: http://msdn.microsoft.com/en-us/magazine/hh975347.aspx

or watch the video from Channel9 by Phil Haack http://channel9.msdn.com/events/Build/BUILD2011/TOOL-803T

Hope this helps.

Upvotes: 1

Related Questions