Search code examples
zend-frameworkmobile-website

How to convert Zend Framework website to mobile website?


i have made a huge website(front & admin side) in Zend Framework now i want to do the same project in ZF but for mobile devices.

i will certainly use HTML5 & jQuery mobile but before go ahead & start my development for my mobile website i want to ask experts what is the nice,easy,efficient and optimized way to do so ???


Solution

  • You'll probably want to checkout the ContextSwitch View Helper - which allows you to switch the view script based on a 'format' parameter. You could use that (or extend it) to switch your view to a more mobile friendly template.

    Take a look at the JSON Context specifically, it disables the layout - the same technique could be used to switch the layout if a mobile request is detected.

    Of course, if you can accomplish what you need with some CSS media queries, that's certainly the way to go.

    You might also find Zend_Http_UserAgent useful to detect the available features of the mobile device. Again, similar to what's possible with media queries, but may be useful nonetheless.

    But the bottom line is there's not need to 'convert' the site, there are plenty of tools to allow the same site to be accessible to both desktop and mobile users.