Jake
Jake

Reputation: 26107

Create Mobile version of website by sharing code

All,

I have the following Zend application structure that uses MVC and supports multiple modules if added. How do I extend this project to create a mobile version of the entire site? The mobile site should support all modules used by the desktop version and reuse as much of controller and models code. If the user accesses through a desktop, the desktop version should be shown, else the mobile version should be displayed. I want to use jquerymobile framework to develop the mobile site.

-application
    -configs
        application.ini
    -layouts
        -scripts
            layout.phtml
    -modules
        -default
            -controllers
                IndexController.php
            -models
            -views
                -helpers
                -scripts
                    -index
                        index.phtml
            Bootstrap.php
Bootstrap.php
-documentation
-include
-library
-logs
-public
    -design
        -css
        -images
        -js
    index.php
    .htaccess
-scripts
-tests
-tmp

Thanks

Upvotes: 0

Views: 287

Answers (1)

DarkLeafyGreen
DarkLeafyGreen

Reputation: 70406

With Zend Framework 1.11 zend introduced the wurfl adapter which is based on Zend_Http_UserAgent.

It allows you to detect mobile devices and bootstrap different layouts. There is a HOW TO on youtube that came with the zend newsletter december 2010: http://www.youtube.com/watch?v=_A8yg73tqOY

You don't have to use different modules! Just different layout files!

Upvotes: 1

Related Questions