1

我正在为我的移动 Web 应用程序使用 Zend Framework 1.11.3 和 Jquery 1.3.0 beta。我参考“ http://juriansluiman.nl/en/article/111/mobile-detection-with-zend_http_useragent ”检查是否用户代理是移动的并使用以下代码:

    $frontController = Zend_Controller_Front::getInstance();
    $bootstrap       = $frontController->getParam('bootstrap');
    if (!$bootstrap->hasResource('useragent')) {
        throw new Zend_Controller_Exception('The mobile plugin can only be loaded when              the UserAgent resource is bootstrapped');
    }
    $userAgent = $bootstrap->getResource('useragent');
    if ($userAgent->getBrowserType() === 'mobile') {
         echo "mobile";
    }
    else
    {
       echo "others";
    }

我收到以下警告:“PHP 警告:include_once(): 未能打开 'Zend/Http/UserAgent/Device/Features/Browscap.php' 以包含 (include_path='/.../application/../library: /.../library:.:/usr/share/php:/usr/share/pear') 在 /.../library/Zend/Loader.php"。但是如果我刷新页面,警告就会消失。任何帮助将不胜感激。在此先感谢。

4

0 回答 0