Method Summary |
string
|
Returns javascript statement that create a new callback request object.
|
protected
array
|
|
protected
array
|
|
string
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
boolean
|
|
void
|
Registers a javascript script block at the beginning of the form
|
void
|
Registers callback javascript for a control.
|
void
|
Register a default button to panel. When the $panel is in focus and the 'enter' key is pressed, the $button will be clicked.
|
void
|
Registers a javascript script block at the end of the form
|
void
|
Registers the control to receive default focus.
|
void
|
Registers a javascript block in the page head.
|
void
|
Registers a javascript file in the page head
|
void
|
Registers a hidden field to be rendered in the form.
|
string
|
Publishes a javascript library path and register packages to be loaded.
|
void
|
Registers postback javascript for a control. A null class parameter will prevent the javascript code registration.
|
void
|
Registers Prado javascript by library name. See "Web/Javascripts/source/packages.php" for library names.
|
void
|
Registers a javascript file to be rendered within the form
|
void
|
Registers a CSS block to be rendered in the page head
|
void
|
Registers a CSS file to be rendered in the page head
|
void
|
|
void
|
|
void
|
|
void
|
|
void
|
|
protected
void
|
Renders the HTML tags for PRADO js files
|
void
|
|
void
|
|
void
|
|
protected
void
|
|
Method Details |
getCallbackReference
public string getCallbackReference |
(ICallbackEventHandler $callbackHandler , array $options ) |
Returns javascript statement that create a new callback request object.
Input |
ICallbackEventHandler | $callbackHandler | callback response handler |
array | $options | additional callback options |
Output |
string
| javascript statement that creates a new callback request. |
Exception |
|
getDefaultButtonOptions
protected array getDefaultButtonOptions |
(string $panelID , string $buttonID ) |
Input |
string | $panelID | the unique ID of the container control |
string | $buttonID | the unique ID of the button control |
Output |
array
| default button options. |
Exception |
|
getPackagePathUrl
protected array getPackagePathUrl |
(string $base ) |
Input |
string | $base | javascript package path. |
Output |
array
| tuple($path,$url). |
Exception |
|
getPradoScriptAssetUrl
public string getPradoScriptAssetUrl |
() |
Output |
string
| Prado javascript library base asset url. |
Exception |
|
getRequiresHead
public boolean getRequiresHead |
() |
Output |
boolean
| whether THead is required in order to render CSS and js within head |
Exception |
|
hasBeginScripts
public boolean hasBeginScripts |
() |
Output |
boolean
| true if any begin scripts are registered. |
Exception |
|
hasEndScripts
public boolean hasEndScripts |
() |
Output |
boolean
| true if any end scripts are registered. |
Exception |
|
isBeginScriptRegistered
public boolean isBeginScriptRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is a beginning javascript block registered with the specified key |
Exception |
|
isEndScriptRegistered
public boolean isEndScriptRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is an ending javascript block registered with the specified key |
Exception |
|
isHeadScriptFileRegistered
public boolean isHeadScriptFileRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is a head javascript file registered with the specified key |
Exception |
|
isHeadScriptRegistered
public boolean isHeadScriptRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is a head javascript block registered with the specified key |
Exception |
|
isHiddenFieldRegistered
public boolean isHiddenFieldRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is a hidden field registered with the specified key |
Exception |
|
isScriptFileRegistered
public boolean isScriptFileRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is a javascript file registered with the specified key |
Exception |
|
isStyleSheetFileRegistered
public boolean isStyleSheetFileRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is a CSS file registered with the specified key |
Exception |
|
isStyleSheetRegistered
public boolean isStyleSheetRegistered |
(string $key ) |
Input |
string | $key | a unique key |
Output |
boolean
| whether there is a CSS block registered with the specified key |
Exception |
|
registerBeginScript
public void registerBeginScript |
(string $key , string $script ) |
Registers a javascript script block at the beginning of the form
Input |
string | $key | a unique key identifying the script block |
string | $script | javascript block |
Output |
Exception |
|
registerCallbackControl
public void registerCallbackControl |
(string $class , array $options ) |
Registers callback javascript for a control.
Input |
string | $class | javascript class responsible for the control being registered for callback |
array | $options | callback options |
Output |
Exception |
|
registerDefaultButton
public void registerDefaultButton |
(TControl|string $panel , TControl|string $button ) |
Register a default button to panel. When the $panel is in focus and the 'enter' key is pressed, the $button will be clicked.
Input |
TControl|string | $panel | panel (or its unique ID) to register the default button action |
TControl|string | $button | button (or its unique ID) to trigger a postback |
Output |
Exception |
|
registerEndScript
public void registerEndScript |
(string $key , string $script ) |
Registers a javascript script block at the end of the form
Input |
string | $key | a unique key identifying the script block |
string | $script | javascript block |
Output |
Exception |
|
registerFocusControl
public void registerFocusControl |
(string $target ) |
Registers the control to receive default focus.
Input |
string | $target | the client ID of the control to receive default focus |
Output |
Exception |
|
registerHeadScript
public void registerHeadScript |
(string $key , string $script ) |
Registers a javascript block in the page head.
Input |
string | $key | a unique key identifying the script block |
string | $script | javascript block |
Output |
Exception |
|
registerHeadScriptFile
public void registerHeadScriptFile |
(string $key , string $url ) |
Registers a javascript file in the page head
Input |
string | $key | a unique key identifying the file |
string | $url | URL to the javascript file |
Output |
Exception |
|
registerHiddenField
public void registerHiddenField |
(string $name , string|array $value ) |
Registers a hidden field to be rendered in the form.
Input |
string | $name | a unique key identifying the hidden field |
string|array | $value | hidden field value, if the value is an array, every element in the array will be rendered as a hidden field value. |
Output |
Exception |
|
registerJavascriptPackages
public string registerJavascriptPackages |
(string $base , array $packages , boolean $debug , boolean $gzip ) |
Publishes a javascript library path and register packages to be loaded.
See TClientScriptLoader for component that enables users to register custom javascript libraries.
Input |
string | $base | javascript library base path |
array | $packages | list of packages or javascript files (without .js extension) to be loaded. |
boolean | $debug | true to enable keep comments in javascript files loaded, null to use application configuration. |
boolean | $gzip | true to gzip the javascript code if browsers and php supports it. |
Output |
string
| javascript src url |
Exception |
|
registerPostBackControl
public void registerPostBackControl |
(string $class , array $options ) |
Registers postback javascript for a control. A null class parameter will prevent the javascript code registration.
Input |
string | $class | javascript class responsible for the control being registered for postback |
array | $options | postback options |
Output |
Exception |
|
registerPradoScript
public void registerPradoScript |
(string $name ) |
Registers Prado javascript by library name. See "Web/Javascripts/source/packages.php" for library names.
Input |
string | $name | script library name. |
Output |
Exception |
|
registerScriptFile
public void registerScriptFile |
(string $key , string $url ) |
Registers a javascript file to be rendered within the form
Input |
string | $key | a unique key identifying the file |
string | $url | URL to the javascript file to be rendered |
Output |
Exception |
|
registerStyleSheet
public void registerStyleSheet |
(string $key , string $css , mixed $media ) |
Registers a CSS block to be rendered in the page head
Input |
string | $key | a unique key identifying the CSS block |
string | $css | CSS block |
mixed | $media | |
Output |
Exception |
|
registerStyleSheetFile
public void registerStyleSheetFile |
(string $key , string $url , string $media ) |
Registers a CSS file to be rendered in the page head
The CSS files in themes are registered in OnPreRenderComplete if you want to override CSS styles in themes you need to register it after this event is completed. Example: - <?php
- class BasePage extends TPage {
- public function onPreRenderComplete($param) {
- parent::onPreRenderComplete($param);
- $url = 'path/to/your/stylesheet.css';
- $this->Page->ClientScript->registerStyleSheetFile($url, $url);
- }
- }
- ?>
Input |
string | $key | a unique key identifying the file |
string | $url | URL to the CSS file |
string | $media | media type of the CSS (such as 'print', 'screen', etc.). Defaults to empty, meaning the CSS applies to all media types. |
Output |
Exception |
|
renderBeginScripts
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
renderEndScripts
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
renderHeadScriptFiles
public void renderHeadScriptFiles |
(THtmlWriter $writer ) |
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
renderHeadScripts
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
renderHiddenFields
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
renderPradoScripts
protected void renderPradoScripts |
(THtmlWriter $writer ) |
Renders the HTML tags for PRADO js files
|
renderScriptFiles
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
renderStyleSheetFiles
public void renderStyleSheetFiles |
(THtmlWriter $writer ) |
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
renderStyleSheets
Input |
THtmlWriter | $writer | writer for the rendering purpose |
Output |
Exception |
|
verifyJavascriptPackages
protected void verifyJavascriptPackages |
(mixed $base , mixed $path , mixed $scripts ) |
Input |
mixed | $base | |
mixed | $path | |
mixed | $scripts | |
Output |
Exception |
throws | TConfigurationException when javascript packages mismatch. |
|