Scripts
class Scripts (View source)
Collects information about which JavaScript files and objects are necessary to render the page and generates the relevant code.
Methods
Adds a new file to the list of scripts
Add new files to the list of scripts
Adds a new code snippet to the code to be executed
Returns a list with filenames and a flag to indicate whether to register onload events for this file
Renders all the JavaScript file inclusions, code and events
Details
__construct(Template $template)
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