model view controller - Return different viewmodels in desktop and mobile versions for the same action in zend framework -


in zf2 application have show database records in mobile , desktop versions different criteria , conditions. mobile version have used getusermobiletable() function , desktop version getuserdesktoptable() .

for mobile version action should work

 public function useraction()     {              return new viewmodel(array('rowset' => $this->getusermobiletable()->select()));     }  

for desktop version action should work

 public function useraction()     {              return new viewmodel(array('rowset' => $this->getuserdesktoptable()->select()));     } 

what should logic it? need use navigator.useragent in javascript detect agent? if how? please i've no idea i'm new zend framework.

you can use mobile detect module detect user's device.

you logic in same action , select different template in example


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -