regClientCSS
Last edited by JP DeVries on Aug 9, 2013.
function regClientCSS(string $src);
API Function Definition
Available since | 0.9.2 |
Parameters
|
|
Registers Client-side CSS scripts - these scripts are loaded just above the </head> tag.
Since the code is inserted into the template's head, your template must have head tags!
Usage / Examples
$myCSS = '<style media="screen"> * {margin:0; padding:0;} </style>'; $modx->regClientCSS( $myCSS );
Related Functions
- ?regClientStartupScript
- regClientScript
- regClientStartupHTMLBlock
- regClientHTMLBlock
Function Source
API Source File - manager/includes/document.parser.class.inc.php - line 2287 in 1.0.5
function regClientCSS($src) { if (isset ($this->loadedjscripts[$src]) && $this->loadedjscripts[$src]) return ''; $this->loadedjscripts[$src]= true; if (stripos($src, "<style") !== false || stripos($src, "<link") !== false) { $this->sjscripts[count($this->sjscripts)]= $src; } else { $this->sjscripts[count($this->sjscripts)]= '<!-- MODx registered -->' . "\n" . ' <link rel="stylesheet" href="' . $src . '" />'; } }
Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab).