0

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?

tereško
  • 56,151
  • 24
  • 92
  • 147
Zach Kauffman
  • 436
  • 4
  • 15
  • The current practice is to use either "responsive design" or (in rare cases) to have "mobile-only subdomain". The former doesn't require any changes in backend code. The latter would let you use a different ootstrap script for the application and thus change the views which are used for UI logic. – tereško May 22 '14 at 04:20

2 Answers2

1

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.

stack
  • 262
  • 2
  • 10
0

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?

Community
  • 1
  • 1
FahadAkram
  • 375
  • 1
  • 3
  • 23