SproutCMS

This is the code documentation for the SproutCMS project

function fileGroup()

Loads a specific file group.
The files in a group are JS and CSS files with matching names, e.g. file.js and file.css
The JS files can be minified, so 'file' will match file.min.js; minified files take precedence.

The group can be:
1. a straight file basename e.g. 'my_file', or
2. sprout plus a file basename, e.g. 'sprout/my_file', or
3. a module name plus a file basename, e.g. 'MyModule/my_file'

The files must be in the 'media/(js/css)/' directory beneath the relevant path.
As per the following exaples:

If the group name 'fb' is requested, the following two files will be included, if they are found:
- media/css/fb.css
- media/js/fb.min.js OR media/js/fb.js

If 'sprout/admin_layout' is requested, the following two files will be included, if they are found:
- sprout/media/css/admin_layout.css
- sprout/media/js/admin_layout.min.js OR sprout/media/js/admin_layout.js

If 'Users/users' is requested, the following two files will be included, if found:
- modules/Users/media/css/users.css
- modules/Users/media/js/users.min.js OR modules/Users/media/js/users.js

Usage

void Needs::fileGroup ( string $name );

Arguments

  1. string $name
    The name of the file group, e.g. 'Forms/admin_fields'

Exceptions thrown

  • Exception
    if there are no matching JS or CSS files

Return value

  • void