VuFind API Documentation

ResourceContainer
in package
Uses VarDumperTrait

VuFind Theme Public Resource Handler (for CSS, JS, etc.)

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Site

Table of Contents

$css  : array<string|int, mixed>
CSS files
$encoding  : string
Encoding type
$favicon  : string|array<string|int, mixed>|null
Favicon
$generator  : string
Generator value for <meta> tag
$js  : array<string|int, mixed>
Javascript files
$less  : array<string|int, mixed>
Less CSS files
addCss()  : void
Add a CSS file.
addJs()  : void
Add a Javascript file.
getCss()  : array<string|int, mixed>
Get CSS files.
getEncoding()  : void
Get the encoding.
getFavicon()  : string|array<string|int, mixed>|null
Get the favicon (null for none).
getGenerator()  : string
Get the generator.
getJs()  : array<string|int, mixed>
Get Javascript files.
parseSetting()  : array<string|int, mixed>
Given a colon-delimited configuration string, break it apart, making sure that URLs in the first position are not inappropriately split.
setEncoding()  : void
Set the encoding.
setFavicon()  : void
Set the favicon.
setGenerator()  : void
Set the generator.
addJsArrayEntry()  : void
Helper function for adding a Javascript file which is described as array.
addJsEntry()  : void
Helper function for adding a Javascript file.
addJsStringEntry()  : void
Helper function for adding a Javascript file which is described as string.
dynamicallyParsed()  : bool
Check if a CSS file is being dynamically compiled in LESS
insertEntry()  : void
Helper function to insert an entry to an array, also considering priority and dependency, if existing.
removeCSS()  : void
Remove a CSS file if it matches another file's name
removeEntry()  : void
Helper function to remove an entry from an array based on filename.
varDump()  : string
Dump variable into string

Properties

$favicon

Favicon

protected string|array<string|int, mixed>|null $favicon = null

Methods

addCss()

Add a CSS file.

public addCss(array<string|int, mixed>|string $css) : void
Parameters
$css : array<string|int, mixed>|string

CSS file (or array of CSS files) to add (possibly with extra settings from theme config appended to each filename string).

Return values
void

addJs()

Add a Javascript file.

public addJs(array<string|int, mixed>|string $js) : void
Parameters
$js : array<string|int, mixed>|string

Javascript file (or array of files) to add (possibly with extra settings from theme config appended to each filename string).

Return values
void

getCss()

Get CSS files.

public getCss() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEncoding()

Get the encoding.

public getEncoding() : void
Return values
void

getFavicon()

Get the favicon (null for none).

public getFavicon() : string|array<string|int, mixed>|null
Return values
string|array<string|int, mixed>|null

getGenerator()

Get the generator.

public getGenerator() : string
Return values
string

getJs()

Get Javascript files.

public getJs([string $position = null ]) : array<string|int, mixed>
Parameters
$position : string = null

Position where the files should be inserted (allowed values are 'header' or 'footer').

Return values
array<string|int, mixed>

parseSetting()

Given a colon-delimited configuration string, break it apart, making sure that URLs in the first position are not inappropriately split.

public parseSetting(string $current) : array<string|int, mixed>
Parameters
$current : string

Setting to parse

Return values
array<string|int, mixed>

setEncoding()

Set the encoding.

public setEncoding(string $e) : void
Parameters
$e : string

New encoding

Return values
void

setFavicon()

Set the favicon.

public setFavicon(string|array<string|int, mixed> $favicon) : void
Parameters
$favicon : string|array<string|int, mixed>

New favicon path.

Return values
void

setGenerator()

Set the generator.

public setGenerator(string $generator) : void
Parameters
$generator : string

New generator.

Return values
void

addJsArrayEntry()

Helper function for adding a Javascript file which is described as array.

protected addJsArrayEntry(string $jsEntry) : void
Parameters
$jsEntry : string

Entry to add as string.

Return values
void

addJsEntry()

Helper function for adding a Javascript file.

protected addJsEntry(string|array<string|int, mixed> $jsEntry) : void
Parameters
$jsEntry : string|array<string|int, mixed>

Entry to add, either as string with path or array with additional properties.

Return values
void

addJsStringEntry()

Helper function for adding a Javascript file which is described as string.

protected addJsStringEntry(string $jsEntry) : void
Parameters
$jsEntry : string

Entry to add as string.

Return values
void

dynamicallyParsed()

Check if a CSS file is being dynamically compiled in LESS

protected dynamicallyParsed(string $file) : bool
Parameters
$file : string

Filename to check

Return values
bool

insertEntry()

Helper function to insert an entry to an array, also considering priority and dependency, if existing.

protected insertEntry(array<string|int, mixed> $entry, array<string|int, mixed> &$array) : void
Parameters
$entry : array<string|int, mixed>

The entry to insert.

$array : array<string|int, mixed>

The array into which the entry shall be inserted.

Return values
void

removeCSS()

Remove a CSS file if it matches another file's name

protected removeCSS(string $file) : void
Parameters
$file : string

Filename to remove

Return values
void

removeEntry()

Helper function to remove an entry from an array based on filename.

protected removeEntry(array<string|int, mixed> $entry, array<string|int, mixed> &$array) : void
Parameters
$entry : array<string|int, mixed>

The entry to remove.

$array : array<string|int, mixed>

The array from which the entry shall be removed.

Return values
void

varDump()

Dump variable into string

protected varDump(mixed $var) : string
Parameters
$var : mixed

Variable to export

Return values
string

Search results