PHP Class TitanFrameworkCSS

Author: Benjamin Intal
ファイルを表示 Open project: gambitph/titan-framework Class Usage Examples

Public Methods

Method Description
__construct ( TitanFramework $frameworkInstance ) : void Class constructor
_generateMissingCSS ( ) : void When the no options are saved yet (e.g. new install) create a CSS, called internally
addCSS ( string $cssString ) : void Adds a CSS string to the list for CSS generation
enqueueCSS ( ) : void Enqueues the generated CSS. Used IF the CSS file was successfully generated
generateCSS ( ) : string Generates a CSS string of all the options
generateMissingCSS ( ) : void When the no options are saved yet (e.g. new install) create a CSS
generateSaveCSS ( ) : void Generates a the CSS file containing all the rules assigned to options, or created using the TitanFramework->createCSS( '.
getOptionsWithCSS ( TitanFrameworkOption $option ) : void Gathers all options with IDs for generation of CSS rules
printCSS ( ) : void Prints the styles in the head tag. Used IF the CSS file could not be generated

Private Methods

Method Description
formCSSVariables ( string $id, $type, string $value, mixes $key = false, string $cssString = '' ) : string Forms CSS rules containing SaSS variables
getCSSFilePath ( ) : string Returns the path of the generated CSS file
getCSSFileURL ( ) : string Returns the URL of the generated CSS file
getCSSSlug ( ) : string Generates a unique slug for our CSS generation
writeCSS ( $parsedCSS, $cssFilename ) : boolean Writes the CSS file

Method Details

__construct() public method

Class constructor
Since: 1.2
public __construct ( TitanFramework $frameworkInstance ) : void
$frameworkInstance TitanFramework an instance of the framework object
return void

_generateMissingCSS() public method

When the no options are saved yet (e.g. new install) create a CSS, called internally
Since: 1.4.1
public _generateMissingCSS ( ) : void
return void

addCSS() public method

Adds a CSS string to the list for CSS generation
Since: 1.2
public addCSS ( string $cssString ) : void
$cssString string string CSS, can contain SaSS variables of optionIDs
return void

enqueueCSS() public method

Enqueues the generated CSS. Used IF the CSS file was successfully generated
Since: 1.2
public enqueueCSS ( ) : void
return void

generateCSS() public method

Generates a CSS string of all the options
Since: 1.2
public generateCSS ( ) : string
return string A CSS string of all the values

generateMissingCSS() public method

When the no options are saved yet (e.g. new install) create a CSS
Since: 1.4.1
public generateMissingCSS ( ) : void
return void

generateSaveCSS() public method

..' ) function.
Since: 1.3
public generateSaveCSS ( ) : void
return void

getOptionsWithCSS() public method

Gathers all options with IDs for generation of CSS rules
Since: 1.2
public getOptionsWithCSS ( TitanFrameworkOption $option ) : void
$option TitanFrameworkOption The option which was just added
return void

printCSS() public method

Prints the styles in the head tag. Used IF the CSS file could not be generated
Since: 1.2
public printCSS ( ) : void
return void