Class \Prado\Web\UI\WebControls\TClientScript
Allows importing of Prado Client Scripts from template via the \Prado\Web\UI\WebControls\setPradoScripts property. Multiple Prado client-scripts can be specified using comma delimited string of the javascript library to include on the page. For example,
<com:TClientScript PradoScripts="effects, rico" />
Custom javascript files can be register using the \Prado\Web\UI\WebControls\setScriptUrl property.
<com:TClientScript ScriptUrl=<%~ test.js %> />
Contents within TClientScript will be treated as javascript code and will be rendered in place.
Since Prado 3.2 the property \Prado\Web\UI\WebControls\setFlushScriptFiles controls whether Prado will flush the script files defined in the page before rendering the TClientScript contents. If you're not using any external functions in your TClientScript block, you should set the \Prado\Web\UI\WebControls\setFlushScriptFiles property to false, so Prado can postpone the loading of all the referenced script files further down the page generation cycle.
Class hierarchy
- \Prado\Web\UI\WebControls\TClientScript
- \Prado\Web\UI\TControl implements IRenderable, IBindable
- \Prado\TApplicationComponent
- \Prado\TComponent
Since: 3.0
public
|
|
public
|
|
public
|
|
public
|
onPreRender(mixed $param) : mixed
Calls the client script manager to add each of the requested client
script libraries.
|
public
|
render(THtmlWriter $writer) : mixed
Renders the body content as javascript block.
Overrides parent implementation, parent renderChildren method is called during registerCustomScript. |
public
|
|
public
|
setPradoScripts(string $value) : mixed
Include javascript library to the current page. The current supported
libraries are: "prado", "effects", "ajax", "validator", "logger",
"datepicker", "colorpicker". Library dependencies are automatically resolved.
|
public
|
|
protected
|
|
protected
|