class Scripts

Collects information about which JavaScript files and objects are necessary to render the page and generates the relevant code.

Methods

__construct()

Generates new Scripts objects

void
addFile(string $filename, array $params = [])

Adds a new file to the list of scripts

void
addFiles(array $filelist)

Add new files to the list of scripts

void
addCode(string $code)

Adds a new code snippet to the code to be executed

array
getFiles()

Returns a list with filenames and a flag to indicate whether to register onload events for this file

string
getDisplay()

Renders all the JavaScript file inclusions, code and events

Details

at line 48
__construct()

Generates new Scripts objects

at line 63
void addFile(string $filename, array $params = [])

Adds a new file to the list of scripts

Parameters

string $filename The name of the file to include
array $params Additional parameters to pass to the file

Return Value

void

at line 87
void addFiles(array $filelist)

Add new files to the list of scripts

Parameters

array $filelist The array of file names

Return Value

void

at line 123
void addCode(string $code)

Adds a new code snippet to the code to be executed

Parameters

string $code The JS code to be added

Return Value

void

at line 134
array getFiles()

Returns a list with filenames and a flag to indicate whether to register onload events for this file

Return Value

array

at line 155
string getDisplay()

Renders all the JavaScript file inclusions, code and events

Return Value

string