API15

API15:JHTML/stylesheet

From Joomla! Documentation

Revision as of 22:18, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Write a <link rel="stylesheet" style="text/css"> element <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JHTML/stylesheet|Edi...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

Write a <link rel="stylesheet" style="text/css"> element

[Edit Descripton]

Template:Description:JHTML/stylesheet

Syntax

stylesheet($filename, $path= 'media/system/css/', $attribs=array())
Parameter Name Default Value Description
$filename The relative URL to use for the href attribute
$path 'media/system/css/'
$attribs array()

Defined in

libraries/joomla/html/html.php

Importing

jimport( 'joomla.html.html' );

Source Body

function stylesheet($filename, $path = 'media/system/css/', $attribs = array())
{
        if(strpos($path, 'http') !== 0) {
                $path =  JURI::root(true).'/'.$path;
        };

        $document = &JFactory::getDocument();
        $document->addStylesheet( $path.$filename, 'text/css', null, $attribs );
        return;
}

[Edit See Also] Template:SeeAlso:JHTML/stylesheet

Examples

<CodeExamplesForm />