2011年2月10日星期四

Re: [fw-mvc] Theming Idea

On Thu, Feb 10, 2011 at 12:38 AM, Jurian Sluiman <subscribe@juriansluiman.nl
> wrote:

> Create a frontController plugin which hooks at an early stage and
> use WURFL (eg the Zend Http browseragent component) to look is a mobile
> switch
> should be set.
> If so, change your view extension from .phtml to .mobile.phtml. Then you
> can
> use your normal layout.phtml and layout.mobile.phtml and as well for the
> views: instead of index.phtml it would become index.mobile.phtml.


I second Jurian's idea but it could probably be improved by extending the
ContextSwitch action helper to support switching to a mobile context using
the same logic that his plugin would use. However the action helper would
let you control which actions will support a mobile view in case you are not
theming the entire site.

--
*Hector Virgen*
Sr. Web Developer
http://www.virgentech.com

没有评论: