[英]Zend_Http_UserAgent to detect Mobile Browsers
我正在嘗試進行一些移動檢測,並且此模塊給我帶來了問題。
$config = array('storage' => array('adapter' => 'Zend_Http_UserAgent_Storage_Session'));
try
{
//$bootstrap = $this->getInvokeArg('bootstrap');
//$userAgent = $bootstrap->getResource('useragent');
//Bootstrap::pr($userAgent);
//echo $userAgent->getUserAgent();
$ua = new Zend_Http_UserAgent($config);
Bootstrap::pr($ua);
Bootstrap::pr($ua->getDevice());
}catch(Exception $e)
{
Bootstrap::pr($e);
}
這在我的索引控制器的索引動作中。
Bootstrap :: pr基本上是一個用<pre>
包裹的print_r
當我打開頁面時,$ ua的print_r可以工作,但隨后它就死了,頁面為空白。 有人可以幫我從這里出去嗎?
看看WURFL-這可能正是您想要的。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.