Class \Prado\Web\UI\TClientScriptManager
TClientScriptManager class.
TClientScriptManager manages javascript and CSS stylesheets for a page.
Class hierarchy
Author: Qiang Xue <qiang.xue@gmail.com>Author: Gabor Berczi <gabor.berczi@devworx.hu> (lazyload additions & progressive rendering)
Since: 3.0
public
|
|
public
|
flushScriptFiles(THtmlWriter $writer[, null|TControl $control = null ]) : mixed
Flushes all pending script registrations
|
public
|
getCallbackReference(ICallbackEventHandler|TControl $callbackHandler[, null|array<string|int, mixed> $options = null ]) : string
Returns javascript statement that create a new callback request object.
|
public
|
|
public
static
|
|
public
|
|
public
|
|
public
static
|
|
public
|
|
public
|
getScriptUrls() : array<string|int, mixed>
Returns the URLs of all script files referenced on the page
|
public
|
getStyleSheetCodes() : array<string|int, mixed>
Returns all the stylesheet code snippets referenced on the page
|
public
|
getStyleSheetUrls() : array<string|int, mixed>
Returns the URLs of all stylesheet files referenced on the page
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
registerBeginScript(string $key, string $script) : mixed
Registers a javascript script block at the beginning of the form
|
public
|
registerCallbackControl(string $class, array<string|int, mixed> $options) : mixed
Registers callback javascript for a control.
|
public
|
registerDefaultButton(string|TControl $panel, string|TControl $button) : mixed
Register a default button to panel. When the $panel is in focus and
the 'enter' key is pressed, the $button will be clicked.
|
public
|
registerEndScript(string $key, string $script) : mixed
Registers a javascript script block at the end of the form
|
public
|
|
public
|
registerHeadScript(string $key, string $script) : mixed
Registers a javascript block in the page head.
|
public
|
registerHeadScriptFile(string $key, string $url[, bool $async = false ]) : mixed
Registers a javascript file in the page head
|
public
|
registerHiddenField(string $name, array<string|int, mixed>|string $value) : mixed
Registers a hidden field to be rendered in the form.
|
public
|
registerPostBackControl(string $class, array<string|int, mixed> $options) : mixed
Registers postback javascript for a control. A null class parameter will prevent
the javascript code registration.
|
public
|
registerPradoScript(string $name) : mixed
Registers Prado javascript by library name. See "Web/Javascripts/packages.php"
for library names.
|
public
|
registerPradoStyle(string $name) : mixed
Registers Prado style by library name. See "Web/Javascripts/packages.php"
for library names.
|
public
|
registerScriptFile(string $key, string $url) : mixed
Registers a javascript file to be rendered within the form
|
public
|
registerStyleSheet(string $key, string $css[, string $media = '' ]) : mixed
Registers a CSS block to be rendered in the page head
|
public
|
registerStyleSheetFile(string $key, string $url[, string $media = '' ]) : mixed
Registers a CSS file to be rendered in the page head
The CSS files in themes are registered in \Prado\Web\UI\OnPreRenderComplete if you want to override CSS styles in themes you need to register it after this event is completed. Example:
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
|
protected
|
renderHiddenFieldsInt(THtmlWriter $writer, mixed $initial) : mixed
Renders hidden fields. To avoid browsers from trying to restore the previous
state of the fields after a page reload, the autocomplete="off" attribute is used.
Unfortunately this attribute is invalid for hidden fields, so text fields are rendered instead (#642). |
protected
|
public
mixed
|
CSS_PACKAGES_FILE
file containing css packages and their cross dependencies
|
'Web/Javascripts/css-packages.php'
|
public
mixed
|
PACKAGES_FILE
file containing javascript packages and their cross dependencies
|
'Web/Javascripts/packages.php'
|
\Prado\TApplicationComponent::FX_CACHE_FILE, \Prado\TComponent::GLOBAL_RAISE_EVENT_LISTENER |