Documentation

Compression_Controller_Css extends Compression_Controller
in package

Compression.

Tags
subpackage

Compression

version
7.x
author

Hostmake LLC

copyright

© 2005-2024 ООО "Хостмэйк" (Hostmake LLC), http://www.hostcms.ru

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
self

buildCss()

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
self

clear()

Clear controller

public clear() : self
Return values
self

compress()

Compress data

public compress(mixed $str, mixed $fileName) : string
Parameters
$str : mixed
$fileName : mixed
Return values
string

deleteAllCss()

Delete all cached files

public deleteAllCss() : self
Return values
self

getContent()

Build CSS and return compressed content

public getContent() : string
Return values
string

getCssDirHref()

Get href of the cache dir for the CSS

public getCssDirHref() : string
Return values
string

getCssDirPath()

Get path of the cache dir for the CSS with CMS_FOLDER

public getCssDirPath() : string
Return values
string

getFilename()

Get filename. Depends on $aCss

public getFilename(array<string|int, mixed> $aCss) : string
Parameters
$aCss : array<string|int, mixed>

Array of paths

Return values
string

getPath()

Build CSS and return path to compressed file

public getPath() : string
Return values
string

instance()

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

Return values
srting

        
On this page

Search results