本文整理匯總了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"]);
}
}