StylesheetManager View code

This class is the backend behind the {cms_queue_css} and {cms_render_css} plugins.

It handles queueing CSS files, and then concatenating them all on output, and generating the appropriate HTML meta tag.

package

CMS

license

GPL

since 2.3

Methods

queue(string $filename, integer $priority = null) 

enqueue a CSS file.

Arguments

string $filename

The absolute path to the CSS file

integer $priority

An optional priroity, this is useful in sorting on render.

render(string $output_path, string $entropy = null, boolean $force = false) : string

Process queued CSS files, and render the appropriate meta tag.

This method will sort the CSS files by their priority and the order added. Then call hooks on each file to preprocess them. Then concatenate the processed output. Call a hook on the resulting concatenated file to post process it Then output the file to the specified directory And return the filename.

This method is intelligent in that it will not perform CSS processing IF the input files have not changed since the last time the output file was generated.

Arguments

string $output_path

The name of the directory where the output CSS file should be written.

string $entropy

Additional data to use when generating the filename.

boolean $force

Force the output stylesheet to be regenerated.

Response

string

The output CSS filename.