API15

JDocument/addStyleSheet: Difference between revisions

From Joomla! Documentation

m removing red link to edit, no existant pages
m preparing for archive only
 
Line 55: Line 55:


===Examples===
===Examples===
<CodeExamplesForm />
=== Code Examples ===
<dpl>
<dpl>
  noresultsheader=\n
  noresultsheader=\n
  category=addStyleSheet
  category=addStyleSheet
  category=JDocument
  category=JDocument
  category=CodeExample
  namespace=CodeExample
  category=MethodExample
  category=MethodExample
  include=*
  include=*

Latest revision as of 00:29, 25 March 2017

Description

Adds a linked stylesheet to the page

[<! removed edit link to red link >]

<! removed transcluded page call, red link never existed >

Syntax

addStyleSheet($url, $type= 'text/css', $media=null, $attribs=array())
Parameter Name Default Value Description
$url $url URL to the linked style sheet
$type 'text/css' $type Mime encoding type
$media null $media Media type that this stylesheet applies to public
$attribs array()

Defined in

libraries/joomla/document/document.php

Importing

jimport( 'joomla.document.document' );

Source Body

function addStyleSheet($url, $type = 'text/css', $media = null, $attribs = array())
{
        $this->_styleSheets[$url]['mime']               = $type;
        $this->_styleSheets[$url]['media']              = $media;
        $this->_styleSheets[$url]['attribs']    = $attribs;
}

[<! removed edit link to red link >] <! removed transcluded page call, red link never existed >

Examples

Code Examples