Skin stuff - autoversioning mainly.
This is the code documentation for the SproutCMS project
Search documentation |
class SkinSkin stuff - autoversioning mainly.
Functions
public commonvoid Skin::common ( ); ECHOs a <link> tag and a <script> tag which point to common.css and common.js respectively. public cssvoid 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 cssUrlstring 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 findTemplatestring Skin::findTemplate ( mixed $name , mixed $extension ); Find a template within the current skin. public jsvoid 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 jsUrlstring 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 modulesvoid 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 |
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Monday, 3rd April, 2023 at 02:59 pm |
|