SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Skin

Skin stuff - autoversioning mainly.

Functions

NameVisibilityDescription
commonpublic (static)ECHOs a <link> tag and a <script> tag which point to common.css and common.js respectively.
csspublic (static)ECHOs one or more <link> tags referring to specified CSS files.
cssUrlpublic (static)Return the URL for a CSS file in the skin for the current subsite.
findTemplatepublic (static)Find a template within the current skin.
jspublic (static)ECHOs one or more <script> tags referring to specified JS files.
jsUrlpublic (static)Return the URL for a JS file in the skin for the current subsite.
modulespublic (static)ECHOs one or more <link> tags for the module css

public common

void Skin::common ( );

ECHOs a <link> tag and a <script> tag which point to common.css and common.js respectively.

public css

void Skin::css ( );

ECHOs one or more <link> tags referring to specified CSS files.
Uses variable arguments, one per css file.
The URLs will contain embedded timestamps, making them auto-versioned

Usage example:
  <?php Skin::css('reset', 'layout', 'content'); ?>

Optionally provide an array to specify attributes, like so:
  <?php Skin::css('site', 'home', ['crossorigin' => 'anonymous', 'media' => 'print']); ?>
Will return:
  <link href="skin-ts/skin/css/site.css" rel='stylesheet' media='print'>
  <link href="skin-ts/skin/css/home.css" rel='stylesheet' media='print'>

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.

public cssUrl

string Skin::cssUrl ( mixed $file );

Return the URL for a CSS file in the skin for the current subsite.
The URL will have an embedded timestamp.

Usage example:
  <link href="<?php echo Skin::cssUrl('layout'); ?>" rel="stylesheet">

public findTemplate

string Skin::findTemplate ( mixed $name , mixed $extension );

Find a template within the current skin.

public js

void Skin::js ( );

ECHOs one or more <script> tags referring to specified JS files.
Uses variable arguments, one per css file.
The URLs will contain embedded timestamps, making them auto-versioned

Usage example:
  <?php Skin::js('site', 'home'); ?>

Optionally provide an array to specify attributes, like so:
  <?php Skin::js('site', 'home', ['crossorigin' => 'anonymous', 'defer' => '']); ?>
Will return:
  <script src="skin-ts/skin/js/site.js" crossorigin="anonymous" defer=""></script>
  <script src="skin-ts/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.

public jsUrl

string Skin::jsUrl ( mixed $file );

Return the URL for a JS file in the skin for the current subsite.
The URL will have an embedded timestamp.

Usage example:
  <script src="<?php echo Skin::cssUrl('site'); ?>"></script>

public modules

void Skin::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