Compression_Controller_Css
extends Compression_Controller
in package
Compression.
Tags
Table of Contents
Properties
- $instance : object
- Object instance
- $_aColors : array<string|int, mixed>
- Colors for replace
- $_aCss : array<string|int, mixed>
- Array of paths
Methods
- addCss() : self
- Add path of CSS
- buildCss() : self
- Build CSS
- clear() : self
- Clear controller
- compress() : string
- Compress data
- deleteAllCss() : self
- Delete all cached files
- getContent() : string
- Build CSS and return compressed content
- getCssDirHref() : string
- Get href of the cache dir for the CSS
- getCssDirPath() : string
- Get path of the cache dir for the CSS with CMS_FOLDER
- getFilename() : string
- Get filename. Depends on $aCss
- getPath() : string
- Build CSS and return path to compressed file
- instance() : object
- Register an existing instance as a singleton.
- _compress() : string
- Compress data
- _getCssContent() : string
- Get content of CSS for array of paths
- _getDriverName() : srting
- Get full driver name
Properties
$instance
Object instance
public
static object
$instance
= \NULL
$_aColors
Colors for replace
protected
static array<string|int, mixed>
$_aColors
= array('#808080' => 'gray', '#008000' => 'green', '#800000' => 'maroon', '#000080' => 'navy', '#808000' => 'olive', '#800080' => 'purple', '#c0c0c0' => 'silver', '#008080' => 'teal')
$_aCss
Array of paths
protected
array<string|int, mixed>
$_aCss
= array()
Methods
addCss()
Add path of CSS
public
addCss(string $path) : self
Parameters
- $path : string
Return values
selfbuildCss()
Build CSS
public
buildCss(string $sFileName[, bool $bReplace = FALSE ]) : self
Parameters
- $sFileName : string
-
CSS filename
- $bReplace : bool = FALSE
-
Replace if exists, default FALSE
Return values
selfclear()
Clear controller
public
clear() : self
Return values
selfcompress()
Compress data
public
compress(mixed $str, mixed $fileName) : string
Parameters
- $str : mixed
- $fileName : mixed
Return values
stringdeleteAllCss()
Delete all cached files
public
deleteAllCss() : self
Return values
selfgetContent()
Build CSS and return compressed content
public
getContent() : string
Return values
stringgetCssDirHref()
Get href of the cache dir for the CSS
public
getCssDirHref() : string
Return values
stringgetCssDirPath()
Get path of the cache dir for the CSS with CMS_FOLDER
public
getCssDirPath() : string
Return values
stringgetFilename()
Get filename. Depends on $aCss
public
getFilename(array<string|int, mixed> $aCss) : string
Parameters
- $aCss : array<string|int, mixed>
-
Array of paths
Return values
stringgetPath()
Build CSS and return path to compressed file
public
getPath() : string
Return values
stringinstance()
Register an existing instance as a singleton.
public
static instance([string $driver = 'http' ]) : object
Parameters
- $driver : string = 'http'
-
driver's name
Return values
object_compress()
Compress data
protected
_compress(mixed $str) : string
Parameters
- $str : mixed
Return values
string_getCssContent()
Get content of CSS for array of paths
protected
_getCssContent(array<string|int, mixed> $aCss) : string
Parameters
- $aCss : array<string|int, mixed>
-
Array of paths
Return values
string_getDriverName()
Get full driver name
protected
static _getDriverName(string $driver) : srting
Parameters
- $driver : string
-
driver name