Provides a system for injecting CSS and Javascript includes into the head of a document even after the head has been outputted. Also does replacement for the string "SITE/", which gets changed into the Kohana root directory.
This is the code documentation for the SproutCMS project
Search documentation |
class NeedsProvides a system for injecting CSS and Javascript includes into the head of a document even after the head has been outputted. Also does replacement for the string "SITE/", which gets changed into the Kohana root directory.
Variables
Functions
public addCssIncludevoid Needs::addCssInclude ( string $url [, array $extra_attrs [, mixed $key ]] ); Adds a CSS include need. public addJavascriptIncludevoid Needs::addJavascriptInclude ( string $url [, array $extra_attrs [, mixed $key ]] ); Adds a JS include need. public addNeedvoid Needs::addNeed ( string $need [, mixed $key ] ); Adds a generic need. If a key is specified, the need is added with that key allowing for updating of the need later. public fileGroupvoid Needs::fileGroup ( string $name ); 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 public removeModulevoid Needs::removeModule ( mixed $key );
Removes a module
e.g. Needs::fileGroup('facebox') can be removed with Needs::removeModule('facebox')
|
| Powered by Pelzini, version 0.9.0 |
Documentation is made available under the
GNU Free Documentation License 1.2. Generated: Wednesday, 5th August, 2026 at 03:31 pm |
|