本文整理汇总了PHP中Website::getBrowser方法的典型用法代码示例。如果您正苦于以下问题:PHP Website::getBrowser方法的具体用法?PHP Website::getBrowser怎么用?PHP Website::getBrowser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Website
的用法示例。
在下文中一共展示了Website::getBrowser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setStyles
public static function setStyles($title = null)
{
$response = sfContext::getInstance()->getResponse();
$response->setTitle($title);
$b = Website::getBrowser();
if (file_exists(SF_ROOT_DIR . "/www/css/frontend.css")) {
$response->addStyleSheet("frontend");
}
if (file_exists(SF_ROOT_DIR . "/www/css/print.css")) {
$response->addStyleSheet("print");
}
if (file_exists(SF_ROOT_DIR . "/www/css/" . $b["browser"] . $b['version'] . ".css")) {
$response->addStyleSheet($b["browser"] . $b['version']);
}
if (file_exists(SF_ROOT_DIR . "/www/css/" . $b["browser"] . ".css")) {
$response->addStyleSheet($b["browser"]);
}
}
示例2: setResponseParams
public function setResponseParams($user = null)
{
$response = $this->getResponse();
if ($user) {
$backend = $user->getBackend();
$type = $user->getType();
} else {
$backend = 0;
}
// HTTP headers
//$response->setContentType('text/xhtml');
//$response->setHttpHeader('Content-Language', 'fr');
//$response->setStatusCode(403);
//$response->addVaryHttpHeader('Accept-Language');
//$response->addCacheControlHttpHeader('no-cache');
// Cookies
//$response->setCookie($name, $content, $expire, $path, $domain);
// Metas and page headers
//$response->addMeta('robots', 'NONE');
//echo $this->pageDocument->getMetaKeywords();
$response->addMeta('keywords', $this->pageDocument->getMetaKeywords());
$response->addMeta('description', $this->pageDocument->getMetaDescription());
//$response->addMeta('language', $this->pageDocument->getMetaLanguage());
if ($this->pageDocument) {
if ($backend && $type == "admin") {
//$response->setCookie('pageId', $this->pageDocument->getId());
$response->setTitle($this->pageDocument->getId());
} else {
if (!$this->pageTitle) {
$this->pageTitle = $this->pageDocument->getNavigationTitle();
}
$response->setTitle($this->pageTitle);
}
}
$b = Website::getBrowser();
if (file_exists(SF_ROOT_DIR . "/www/css/frontend.css")) {
$response->addStyleSheet("frontend");
}
if (file_exists(SF_ROOT_DIR . "/www/css/print.css")) {
$response->addStyleSheet("print");
}
if (file_exists(SF_ROOT_DIR . "/www/css/" . $b["browser"] . $b['version'] . ".css")) {
$response->addStyleSheet($b["browser"] . $b['version']);
}
if (file_exists(SF_ROOT_DIR . "/www/css/" . $b["browser"] . ".css")) {
$response->addStyleSheet($b["browser"]);
}
}