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 - CUDA code not processing if block properly -

oracle11g - get root domain from url Oracle sql regex_substr -

xcode - Swift Playground - Files are not readable -