PHP Class Backend\Core\Engine\Header

..)
Inheritance: extends Backend\Core\Engine\Base\Object
Datei anzeigen Open project: forkcms/forkcms Class Usage Examples

Public Methods

Method Description
__construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
addCSS ( string $file, string $module = null, boolean $overwritePath = false, boolean $minify = true, boolean $addTimestamp = false ) Add a CSS-file.
addJS ( string $file, string $module = null, boolean $minify = true, boolean $overwritePath = false, boolean $addTimestamp = false ) Add a JS-file.
addJsData ( string $module, string $key, mixed $value ) Add data into the jsData
getCSSFiles ( ) : array Get all added CSS files
getJSFiles ( ) : array get all added javascript files
parse ( ) Parse the header into the template
parseCSS ( ) Parse the CSS-files
parseJS ( ) Parse the JS-files

Private Methods

Method Description
minifyCSS ( string $file ) : string Minify a CSS-file
minifyJS ( string $file ) : string Minify a JS-file

Method Details

__construct() public method

public __construct ( Symfony\Component\HttpKernel\KernelInterface $kernel )
$kernel Symfony\Component\HttpKernel\KernelInterface

addCSS() public method

If you don't specify a module, the current one will be used to automatically create the path to the file. Automatic creation of the filename will result in src/Backend/Modules/MODULE/Layout/Css/FILE (for modules) src/Backend/Core/Layout/Css/FILE (for core) If you set overwritePath to true, the above-described automatic path creation will not happen, instead the file-parameter will be used as path; which we then expect to be a full path (It has to start with a slash '/')
public addCSS ( string $file, string $module = null, boolean $overwritePath = false, boolean $minify = true, boolean $addTimestamp = false )
$file string The name of the file to load.
$module string The module wherein the file is located.
$overwritePath boolean Should we overwrite the full path?
$minify boolean Should the CSS be minified?
$addTimestamp boolean May we add a timestamp for caching purposes?

addJS() public method

If you don't specify a module, the current one will be used If you set overwritePath to true we expect a full path (It has to start with a /)
public addJS ( string $file, string $module = null, boolean $minify = true, boolean $overwritePath = false, boolean $addTimestamp = false )
$file string The file to load.
$module string The module wherein the file is located.
$minify boolean Should the module be minified?
$overwritePath boolean Should we overwrite the full path?
$addTimestamp boolean May we add a timestamp for caching purposes?

addJsData() public method

Add data into the jsData
public addJsData ( string $module, string $key, mixed $value )
$module string The name of the module.
$key string The key whereunder the value will be stored.
$value mixed The value

getCSSFiles() public method

Get all added CSS files
public getCSSFiles ( ) : array
return array

getJSFiles() public method

get all added javascript files
public getJSFiles ( ) : array
return array

parse() public method

Parse the header into the template
public parse ( )

parseCSS() public method

Parse the CSS-files
public parseCSS ( )

parseJS() public method

Parse the JS-files
public parseJS ( )