We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 6 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
我还没有听说过专门针对移动客户端的 PHP 框架。如果我是你,我不会尝试找到一个专门的框架,而只是定义你的一般需求,然后看看哪个框架可以最好地满足它们。不同客户的识别可以轻松集成到任何现有框架中。
I haven't heard of a PHP Framework that specializes on mobile clients. If I were you I wouldn't try to find a specialized Framework but just define your needs in general and see which framework can cover them best. The recognition of the different clients can be easily integrated into any existing framework.
Codeigniter 有一个名为 用户代理 的类。
但是,您可能必须为移动浏览器创建自己的类。
用户代理类提供的功能可帮助识别有关访问您网站的浏览器、移动设备或机器人的信息。此外,您还可以获得引荐来源网址信息以及语言和支持的字符集信息。
例子:
当用户代理类初始化时,它将尝试确定浏览您站点的用户代理是 Web 浏览器、移动设备还是机器人。如果有的话,它还将收集平台信息。
Codeigniter has a class called User Agent.
However you may have to create your own class for mobile browsers.
The User Agent Class provides functions that help identify information about the browser, mobile device, or robot visiting your site. In addition you can get referrer information as well as language and supported character-set information.
Example:
When the User Agent class is initialized it will attempt to determine whether the user agent browsing your site is a web browser, a mobile device, or a robot. It will also gather the platform information if it is available.
移动浏览器与桌面浏览器一样,都有自己的问题和“特殊需求”,因此最好进行检查以查看您要输出到哪个浏览器,因为它可能会极大地影响输出。
Mobile browsers, like desktop browsers, all have their own problems and "special needs" so it would be a good idea to include a check to see what browser you are outputting to, because it could affect the output greatly.
CakePHP 作为内置 RequestHandler 组件的一部分,根据大量已知设备检查用户代理字符串,因此可以自动向这些客户端显示不同的内容。
这是它的比较列表:
即使您不使用 CakePHP,您可以查看该文件的源代码,以了解有关它如何处理这些请求的更多信息。
CakePHP, as part of the built-in RequestHandler component, checks the User Agent string against a big list of known devices and can therefore automatically display different content to those clients.
Here's the list it compares against:
Even you don't go with CakePHP, you can take a look at the source of that file to see more about how it handles those requests.