PHP Class AssetModel, vanilla

Inheritance: extends CommonModel
Datei anzeigen Open project: vanilla/vanilla Class Usage Examples

Public Properties

Property Type Description
$UrlPrefix string

Protected Properties

Property Type Description
$_CssFiles List of CSS files to serve.

Public Methods

Method Description
addCssFile ( $filename, boolean $folder = false, boolean $options = false ) Add to the list of CSS files to serve.
cssPath ( string $filename, string $folder = '', string $themeType = '' ) : array | boolean Lookup the path to a CSS file and return its info array
eTag ( ) : string Generate an e-tag for the application from the versions of all of its enabled applications/plugins.
getAnchors ( ) : array Get list of CSS anchor files
getCssFiles ( $themeType, $basename, $eTag, null &$notFound = null ) : array
jsPath ( string $filename, string $folder = '', string $themeType = '' ) : array | boolean Lookup the path to a JS file and return its info array
resourceHash ( array $resources ) : string Generate a hash for a group of resources, based on keys + versions
serveCss ( $themeType, $filename ) Serve all CSS files.
viewExtensions ( boolean $fresh = false ) : array Get list of allowed view extensions
viewHandlers ( boolean $fresh = false ) : array Get list of defined view handlers
viewLocation ( string $view, string $controller, string $folder, array | null $extensions = null ) : string | false Get the path to a view.

Protected Methods

Method Description
_comparePath ( $a, $b ) : integer Sorting callback

Method Details

_comparePath() protected method

Sorting callback
protected _comparePath ( $a, $b ) : integer
$a
$b
return integer

addCssFile() public method

Add to the list of CSS files to serve.
public addCssFile ( $filename, boolean $folder = false, boolean $options = false )
$filename
$folder boolean
$options boolean

cssPath() public static method

Lookup the path to a CSS file and return its info array
public static cssPath ( string $filename, string $folder = '', string $themeType = '' ) : array | boolean
$filename string name/relative path to css file
$folder string optional. app or plugin folder to search
$themeType string mobile or desktop
return array | boolean

eTag() public static method

Generate an e-tag for the application from the versions of all of its enabled applications/plugins.
public static eTag ( ) : string
return string etag

getAnchors() public static method

Fires an event to allow loaded applications to create their own CSS aggregation domains.
public static getAnchors ( ) : array
return array

getCssFiles() public method

public getCssFiles ( $themeType, $basename, $eTag, null &$notFound = null ) : array
$themeType
$basename
$eTag
$notFound null
return array

jsPath() public static method

Lookup the path to a JS file and return its info array
public static jsPath ( string $filename, string $folder = '', string $themeType = '' ) : array | boolean
$filename string name/relative path to js file
$folder string optional. app or plugin folder to search
$themeType string mobile or desktop
return array | boolean

resourceHash() public method

Generate a hash for a group of resources, based on keys + versions
public resourceHash ( array $resources ) : string
$resources array
return string

serveCss() public method

Serve all CSS files.
public serveCss ( $themeType, $filename )
$themeType
$filename

viewExtensions() public static method

Get list of allowed view extensions
public static viewExtensions ( boolean $fresh = false ) : array
$fresh boolean
return array list of extensions

viewHandlers() public static method

Get list of defined view handlers
public static viewHandlers ( boolean $fresh = false ) : array
$fresh boolean
return array

viewLocation() public static method

Get the path to a view.
public static viewLocation ( string $view, string $controller, string $folder, array | null $extensions = null ) : string | false
$view string the name of the view.
$controller string the name of the controller invoking the view or blank.
$folder string the application folder or plugins/ folder.
$extensions array | null optional. list of extensions to allow
return string | false The path to the view or false if it wasn't found.

Property Details

$UrlPrefix public_oe property

public string $UrlPrefix
return string

$_CssFiles protected_oe property

List of CSS files to serve.
protected $_CssFiles