protected function _renderStyle($style, $link, $attribs = array())
    {
        //get the correct URL
        if ($link) {
            $style = pick($this->getService('com:base.template.asset')->getURL($style), $style);
        }

        //if ajax try to get the content of the file
        if (AnRequest::type() == 'AJAX') {
            if ($link) {
                $file = $this->getService('com:base.template.asset')->getFilePath($style);
                if ($file) {
                    $style = file_get_contents($file);
                    $link = false;
                }
            }

            return parent::_renderStyle($style, $link, $attribs);
        }

        $document = AnService::get('anahita:document');

        if($link) {
            return $document->addStyleSheet($style, 'text/css', null, $attribs);
        } else {
            return $document->addStyleDeclaration($style);
        }
    }
protected function _renderStyle($style, $link, $attribs = array())
    {
        //get the correct URL
        if ($link) {
            $style = pick($this->getService('com:base.template.asset')->getURL($style), $style);
        }

        //if ajax try to get the content of the file
        if (AnRequest::type() == 'AJAX') {
            if ($link) {
                $file = $this->getService('com:base.template.asset')->getFilePath($style);
                if ($file) {
                    $style = file_get_contents($file);
                    $link = false;
                }
            }

            return parent::_renderStyle($style, $link, $attribs);
        }

        $document = AnService::get('anahita:document');

        if($link) {
            return $document->addStyleSheet($style, 'text/css', null, $attribs);
        } else {
            return $document->addStyleDeclaration($style);
        }
    }
protected function _renderStyle ( $ style , $ link , $ attribs = array ( ) ) { //get the correct URL if ( $ link ) { $ style = pick ( $ this -> getService ( 'com:base.template.asset' ) -> getURL ( $ style ) , $ style ) ; } //if ajax try to get the content of the file if ( AnRequest :: type ( ) == 'AJAX' ) { if ( $ link ) { $ file = $ this -> getService ( 'com:base.template.asset' ) -> getFilePath ( $ style ) ; if ( $ file ) { $ style = file_get_contents ( $ file ) ; $ link = false ; } } return parent :: _renderStyle ( $ style , $ link , $ attribs ) ; } $ document = AnService :: get ( 'anahita:document' ) ; if ( $ link ) { return $ document -> addStyleSheet ( $ style , 'text/css' , null , $ attribs ) ; } else { return $ document -> addStyleDeclaration ( $ style ) ; } }
Render style information.

@param string    The style information
@param bool   True, if the style information is a URL
@param array     Associative array of attributes

@return string
Render style information .