如何在 Zend Framework 中处理移动设备? [英] How to handle mobile devices in Zend Framework?

查看:20
本文介绍了如何在 Zend Framework 中处理移动设备?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我接手了一个噩梦般的项目!我正在迁移一个写得很糟糕的站点,然后慢慢地将它迁移到 Zend Framework 应用程序中.不幸的是,我没有时间做补救工作以使这甚至可以忍受(可能是一两个模型).我现在被告知很快就会有该网站的移动版本,并且建议克隆旧网站并使用它.为了不处理相同废话的不同版本并为自己争取一些时间,我建议 ZF 网站应该处理这一切.

I've taken over a nightmare of a project! I'm moving a very poorly written site and moving it slowly into a Zend Framework application. Unfortunately I have no time to do the remedial work to make this even bearable (maybe a model or two). I have now been told that it is soon to have mobile version of the site and the proposal has been to clone the old site and work with that. In an attempt to not work on different versions of the same crap and buy myself some time I proposed that the ZF site should handle it all.

使用 Zend_Http_UserAgent 检测然后简单地加载替代布局和内容是一种糟糕的做法吗?

Is it awful practice to use Zend_Http_UserAgent to detect then simply load an alternative layout and content?

一开始我倾向于使用两个模块,但在模块中使用 ACL 时遇到了一些麻烦.

I was inclined to use two modules at first but I've had a bit of trouble with ACLs in modules.

欢迎提供任何替代建议!

Any alternative suggestions are welcome!

干杯

推荐答案

Zend Framework 1.11 中,zend 引入了 wurfl 适配器 基于 Zend_Http_UserAgent.

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

它允许您检测移动设备并引导不同的布局.2010 年 12 月 Zend 时事通讯随附的 youtube 上有一个 HOW TO:http://www.youtube.com/watch?v=_A8yg73tqOY

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!

这篇关于如何在 Zend Framework 中处理移动设备?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆