本文整理汇总了PHP中Mobile_Detect::getDeviceName方法的典型用法代码示例。如果您正苦于以下问题:PHP Mobile_Detect::getDeviceName方法的具体用法?PHP Mobile_Detect::getDeviceName怎么用?PHP Mobile_Detect::getDeviceName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mobile_Detect
的用法示例。
在下文中一共展示了Mobile_Detect::getDeviceName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: log
public function log()
{
if ($this->getCurrentOptionValue()) {
$uri = $this->getFullActionName();
$log = new Core_Model_Log();
$detect = new Mobile_Detect();
$host = !empty($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : '';
$user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$other = array('user_agent' => $user_agent, 'host' => $host);
if ($this->getSession()->getCustomerId()) {
$log->setCustomerId($this->getSession()->getCustomerId());
}
$log->setUri($uri)->setDeviceName($detect->getDeviceName())->setOther(serialize($other))->save();
}
return $this;
}
示例2: _log
protected function _log()
{
if ($this->getRequest()->isGet() && $this->getFullActionName("/") == "front/mobile/backgroundimage" && $this->getDevice()->isNative()) {
$log = new Core_Model_Log();
$detect = new Mobile_Detect();
$host = !empty($_SERVER['REMOTE_HOST']) ? $_SERVER['REMOTE_HOST'] : '';
$user_agent = !empty($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
$other = array('user_agent' => $user_agent, 'host' => $host);
$value_id = $this->getCurrentOptionValue()->getId() | 0;
if ($this->getSession()->getCustomerId()) {
$log->setCustomerId($this->getSession()->getCustomerId());
}
$log->setCustomerId($this->getSession()->getCustomerId())->setAppId($this->getApplication()->getId())->setValueId($value_id)->setDeviceName($detect->getDeviceName())->setOther(serialize($other))->save();
}
return $this;
}