Methods summary
public
|
#
__construct( TPage $owner )
Constructor.
Parameters
- $owner
TPage
page that owns this client script manager
Overrides
|
public
boolean
|
#
getRequiresHead( )
Returns
boolean whether THead is required in order to render CSS and js within head
Since
3.1.1
|
public static
|
|
public static
|
|
public
|
#
registerPradoScript( string $name )
Registers Prado javascript by library name. See
"Web/Javascripts/packages.php" for library names.
Registers Prado javascript by library name. See
"Web/Javascripts/packages.php" for library names.
Parameters
- $name
string script library name.
|
protected
|
#
registerPradoScriptInternal( mixed $name )
Registers a Prado javascript library to be loaded.
Registers a Prado javascript library to be loaded.
|
public
string
|
#
getPradoScriptAssetUrl( )
Returns
string Prado javascript library base asset url.
|
public
array
|
#
getScriptUrls( )
Returns the URLs of all script files referenced on the page
Returns the URLs of all script files referenced on the page
Returns
array Combined list of all script urls used in the page
|
protected
array
|
#
getPackagePathUrl( string $base )
Parameters
- $base
string javascript package path.
Returns
array tuple($path,$url).
|
public
string
|
#
getCallbackReference( ICallbackEventHandler $callbackHandler, array $options = null )
Returns javascript statement that create a new callback request object.
Returns javascript statement that create a new callback request object.
Parameters
- $callbackHandler
ICallbackEventHandler
callback response handler
- $options
array additional callback options
Returns
string javascript statement that creates a new callback request.
|
public
|
#
registerCallbackControl( string $class, array $options )
Registers callback javascript for a control.
Registers callback javascript for a control.
Parameters
- $class
string javascript class responsible for the control being registered for callback
- $options
array callback options
|
public
|
#
registerPostBackControl( string $class, array $options )
Registers postback javascript for a control. A null class parameter will
prevent the javascript code registration.
Registers postback javascript for a control. A null class parameter will
prevent the javascript code registration.
Parameters
- $class
string javascript class responsible for the control being registered for postback
- $options
array postback options
|
public
|
#
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.
Register a default button to panel. When the $panel is in focus and the
'enter' key is pressed, the $button will be clicked.
Parameters
- $panel
TControl |string
panel (or its unique ID) to register the default button action
- $button
TControl |string
button (or its unique ID) to trigger a postback
|
protected
array
|
#
getDefaultButtonOptions( string $panelID, string $buttonID )
Parameters
- $panelID
string the unique ID of the container control
- $buttonID
string the unique ID of the button control
Returns
array default button options.
|
public
|
#
registerFocusControl( string $target )
Registers the control to receive default focus.
Registers the control to receive default focus.
Parameters
- $target
string the client ID of the control to receive default focus
|
public
|
#
registerStyleSheetFile( string $key, string $url, string $media = '' )
Registers a CSS file to be rendered in the page head
Registers a CSS file to be rendered in the page head
The CSS files in themes are registered in OnPreRenderComplete
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);
}
}
Parameters
- $key
string a unique key identifying the file
- $url
string URL to the CSS file
- $media
string media type of the CSS (such as 'print', 'screen', etc.). Defaults to empty,
meaning the CSS applies to all media types.
|
public
|
#
registerStyleSheet( string $key, string $css, mixed $media = '' )
Registers a CSS block to be rendered in the page head
Registers a CSS block to be rendered in the page head
Parameters
- $key
string a unique key identifying the CSS block
- $css
string CSS block
- $media
|
public
array
|
#
getStyleSheetUrls( )
Returns the URLs of all stylesheet files referenced on the page
Returns the URLs of all stylesheet files referenced on the page
Returns
array List of all stylesheet urls used in the page
|
public
array
|
#
getStyleSheetCodes( )
Returns all the stylesheet code snippets referenced on the page
Returns all the stylesheet code snippets referenced on the page
Returns
array List of all stylesheet snippets used in the page
|
public
|
#
registerHeadScriptFile( string $key, string $url )
Registers a javascript file in the page head
Registers a javascript file in the page head
Parameters
- $key
string a unique key identifying the file
- $url
string URL to the javascript file
|
public
|
#
registerHeadScript( string $key, string $script )
Registers a javascript block in the page head.
Registers a javascript block in the page head.
Parameters
- $key
string a unique key identifying the script block
- $script
string javascript block
|
public
|
#
registerScriptFile( string $key, string $url )
Registers a javascript file to be rendered within the form
Registers a javascript file to be rendered within the form
Parameters
- $key
string a unique key identifying the file
- $url
string URL to the javascript file to be rendered
|
public
|
#
registerBeginScript( string $key, string $script )
Registers a javascript script block at the beginning of the form
Registers a javascript script block at the beginning of the form
Parameters
- $key
string a unique key identifying the script block
- $script
string javascript block
|
public
|
#
registerEndScript( string $key, string $script )
Registers a javascript script block at the end of the form
Registers a javascript script block at the end of the form
Parameters
- $key
string a unique key identifying the script block
- $script
string javascript block
|
public
|
#
registerHiddenField( string $name, string|array $value )
Registers a hidden field to be rendered in the form.
Registers a hidden field to be rendered in the form.
Parameters
- $name
string a unique key identifying the hidden field
- $value
string|array hidden field value, if the value is an array, every element in the array will be
rendered as a hidden field value.
|
public
boolean
|
#
isStyleSheetFileRegistered( string $key )
Parameters
Returns
boolean whether there is a CSS file registered with the specified key
|
public
boolean
|
#
isStyleSheetRegistered( string $key )
Parameters
Returns
boolean whether there is a CSS block registered with the specified key
|
public
boolean
|
#
isHeadScriptFileRegistered( string $key )
Parameters
Returns
boolean whether there is a head javascript file registered with the specified key
|
public
boolean
|
#
isHeadScriptRegistered( string $key )
Parameters
Returns
boolean whether there is a head javascript block registered with the specified key
|
public
boolean
|
#
isScriptFileRegistered( string $key )
Parameters
Returns
boolean whether there is a javascript file registered with the specified key
|
public
boolean
|
#
isBeginScriptRegistered( string $key )
Parameters
Returns
boolean whether there is a beginning javascript block registered with the specified key
|
public
boolean
|
#
isEndScriptRegistered( string $key )
Parameters
Returns
boolean whether there is an ending javascript block registered with the specified key
|
public
boolean
|
#
hasEndScripts( )
Returns
boolean true if any end scripts are registered.
|
public
boolean
|
#
hasBeginScripts( )
Returns
boolean true if any begin scripts are registered.
|
public
boolean
|
#
isHiddenFieldRegistered( string $key )
Parameters
Returns
boolean whether there is a hidden field registered with the specified key
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
#
renderScriptFilesBegin( mixed $writer )
|
public
|
#
renderScriptFilesEnd( mixed $writer )
|
public
|
#
markScriptFileAsRendered( mixed $url )
|
protected
|
#
renderScriptFiles( mixed $writer, array $scripts )
|
protected
|
#
getRenderedScriptFiles( )
|
public
|
|
public
|
|
public
|
|
public
|
#
renderHiddenFieldsBegin( mixed $writer )
|
public
|
#
renderHiddenFieldsEnd( mixed $writer )
|
public
|
#
flushScriptFiles( THtmlWriter $writer, TControl $control = null )
Flushes all pending script registrations
Flushes all pending script registrations
Parameters
- $writer
THtmlWriter
writer for the rendering purpose
- $control
TControl
the control forcing the flush (used only in error messages)
|
protected
|
#
renderHiddenFieldsInt( THtmlWriter $writer, mixed $initial )
Parameters
- $writer
THtmlWriter
writer for the rendering purpose
- $initial
|
public
|
|
protected
|
#
checkIfNotInRender( )
Checks whether page rendering has not begun yet
Checks whether page rendering has not begun yet
|