browser::css PHP Method

css() static public method

Returns a browser-specific css selector string
static public css ( string $ua = null, boolean $array = false ) : mixed
$ua string The user agent string
$array boolean True: return an array, false: return a string
return mixed
    static function css($ua = null, $array = false)
    {
        self::detect($ua);
        $css[] = self::$engine;
        $css[] = self::$name;
        if (self::$version) {
            $css[] = self::$name . str_replace('.', '_', self::$version);
        }
        $css[] = self::$platform;
        return $array ? $css : implode(' ', $css);
    }

Usage Example

Example #1
0
 private function _getOutput()
 {
     // Make $template and $title accessible in the descendant views
     $this->__set('template', $this);
     $this->__set('title', $this->title);
     // Template View (must run first since ancestor views might call functions from $template)
     $templateView = XML::text($this->_template->__toString());
     // <html>
     $this->_html = XML::element('html');
     $this->_html->dir = $this->dir;
     if (Kennel::getSetting('i18n', 'enabled')) {
         $this->_html->lang = i18n::getLang();
     }
     // <head>
     $this->_head = XML::element('head', $this->_html);
     // <title>
     $title = XML::element('title', $this->_head);
     $title->setValue($this->getTitle());
     // favicon
     if ($this->favicon) {
         $this->_head->adopt(html::favicon($this->favicon));
     }
     // Content Type
     $this->_head->adopt(html::meta(array('charset' => 'utf-8')));
     // <meta>
     foreach ($this->_meta as $meta) {
         $this->_head->adopt(html::meta($meta));
     }
     // <link>
     foreach ($this->_links as $link) {
         $this->_head->adopt(html::link($link['rel'], $link['href'], $link['type'], $link['title']));
     }
     // <style>
     $this->_head->adopt(html::css($this->_stylesheets));
     // <script>
     $this->_head->adopt(html::js($this->_scripts));
     // <body>
     $this->_body = XML::element('body', $this->_html);
     $this->_body->class = browser::css();
     if (Kennel::getSetting('i18n', 'enabled')) {
         $this->_body->class .= ' ' . i18n::getLang();
     }
     if ($this->bodyClass) {
         $this->_body->class .= ' ' . $this->bodyClass;
     }
     // Inject the Template View
     $this->_body->adopt($templateView);
     // Return the whole shebang
     return self::$DOCTYPE_DECLARATIONS[$this->doctype] . $this->_html->output(true);
 }
All Usage Examples Of browser::css