\TkiRequirements_Backend
Synopsis
class TkiRequirements_Backend
extends Requirements_Backend
{
- // members
- protected array $requirementsHtml = ;
- private static integer $default_priority = 50;
- // methods
- public void stylesheets()
- public void js()
- public void script()
- public void customScript()
- public void styles()
- public void customCSS()
- public array get_custom_scripts()
- public string includeInHTML()
- public void include_in_response()
- protected array separateJsByLocation()
- protected string determineLocation()
- protected void sortByPriority()
- protected string generateJsElements()
- protected string generateCssElements()
- protected void includeJs()
- protected void includeCss()
- protected void includeCustomHeadTags()
- protected void typeAllowed()
- public boolean extendedCombine()
- public void requireFiles()
- protected void addCss()
- protected void addJs()
- protected void addJavascript()
- protected array getFileInfo()
- protected array separateFilesByType()
- public void process_combined_files()
- protected void removeFileExtension()
- protected string addFileExtension()
- protected boolean endsWith()
Hierarchy
Extends
- Requirements_Backend
Tasks
Line | Task |
---|---|
949+ | - Move to utility library |
Members
private
- $default_priority
—
int
Default priority
protected
- $requirementsHtml
—
string
Generated HTML which is inserted into document
Methods
protected
- addCss() — Adds CSS files
- addFileExtension() — Adds file extension if not present, given type.
- addJavascript() — Wrapper method
- addJs() — Adds JavaScript files
- determineLocation() — Determines location for item, based on default or location specified in options.
- endsWith() — Tests if string ends with substring
- generateCssElements() — Generates HTML for
- generateJsElements() — Creates HTML to include JavaScript, given array of JavaScript items.
- getFileInfo() — Finds file path and extension.
- includeCss()
- includeCustomHeadTags()
- includeJs() — Sorts provided JavaScript items according to target location and priority, then adds the generated HTML to $this->requirementsHtml. HTML generation is performed by helper methods.
- removeFileExtension()
- separateFilesByType() — Separates files according to type: CSS or JavaScript.
- separateJsByLocation() — Sorts array of files according to target location.
- sortByPriority() — Sorts files by priority given in file options. Default priority used if not provided.
- typeAllowed()
public
- customCSS() — Override parent method to make use of options
- customScript() — Override parent method to make use of options
- extendedCombine()
- get_custom_scripts() — Return all registered custom scripts
- includeInHTML()
- include_in_response() — Attach requirements inclusion to X-Include-JS and X-Include-CSS headers on the given HTTP Response
- js() — Include JavaScript file(s)
- process_combined_files() — A revised version of the parent method which retains file prioritisation
- requireFiles() — Require multiple files, with options. Allows mixture of CSS and JS files.
- script() — Include custom script
- styles() — Include custom styles
- stylesheets() — Include CSS file(s)