Skin
in package
Skin stuff - autoversioning mainly.
Table of Contents
Methods
- common() : mixed
- ECHOs a <link> tag and a <script> tag which point to common.css and common.js respectively.
- css() : mixed
- ECHOs one or more <link> tags referring to specified CSS files.
- cssUrl() : string
- Return the URL for a CSS file in the skin for the current subsite.
- findTemplate() : string
- Find a template within the current skin.
- js() : mixed
- ECHOs one or more <script> tags referring to specified JS files.
- jsUrl() : string
- Return the URL for a JS file in the skin for the current subsite.
- modules() : mixed
- ECHOs one or more <link> tags for the module css Uses either modules.css in the the skin css directory or the module.css in the modules media directories
Methods
common()
ECHOs a <link> tag and a <script> tag which point to common.css and common.js respectively.
public
static common() : mixed
css()
ECHOs one or more <link> tags referring to specified CSS files.
public
static css(mixed ...$args) : mixed
Uses variable arguments, one per css file. The URLs will contain embedded timestamps, making them auto-versioned
Usage example:
Optionally provide an array to specify attributes, like so:
'anonymous', 'media' => 'print']); ?>Will return:
There isn't a guarantee that multiple tags will be ECHOed, but the order will always remain as specified.
If you need more control use the helper css_url and echo the tags yourself.
Parameters
- $args : mixed
cssUrl()
Return the URL for a CSS file in the skin for the current subsite.
public
static cssUrl(string $file[, int $ts = null ]) : string
The URL will have an embedded timestamp.
Usage example:
Parameters
- $file : string
- $ts : int = null
-
ignored
Return values
string —URL for the specified css file
findTemplate()
Find a template within the current skin.
public
static findTemplate(mixed $name, mixed $extension) : string
Parameters
- $name : mixed
- $extension : mixed
Tags
Return values
stringjs()
ECHOs one or more <script> tags referring to specified JS files.
public
static js(mixed ...$args) : mixed
Uses variable arguments, one per css file. The URLs will contain embedded timestamps, making them auto-versioned
Usage example:
Optionally provide an array to specify attributes, like so:
'anonymous', 'defer' => '']); ?>Will return:
<script src="skin/js/site.js" crossorigin="anonymous" defer=""></script> <script src="skin/js/home.js" crossorigin="anonymous" defer=""></script>There isn't a guarantee that multiple tags will be ECHOed, but the order will always remain as specified.
If you need more control use the helper js_url and echo the tags yourself.
Parameters
- $args : mixed
jsUrl()
Return the URL for a JS file in the skin for the current subsite.
public
static jsUrl(string $file[, int $ts = null ]) : string
The URL will have an embedded timestamp.
Usage example:
<script src=""></script>Parameters
- $file : string
- $ts : int = null
-
ignored
Return values
string —URL for the specified js file
modules()
ECHOs one or more <link> tags for the module css Uses either modules.css in the the skin css directory or the module.css in the modules media directories
public
static modules() : mixed