static
void
getPradoPackages
()
static
void
getPradoScripts
()
Constructor.
TClientScriptManager
__construct
(
TPage $owner)
-
TPage
$owner: page that owns this client script manager
Checks whether page rendering has not begun yet
void
checkIfNotInRender
()
Flushes all pending script registrations
-
THtmlWriter
$writer: writer for the rendering purpose
-
TControl
$control: the control forcing the flush (used only in error messages)
Returns javascript statement that create a new callback request object.
string
getCallbackReference
( $callbackHandler, [array $options = null])
-
ICallbackEventHandler
$callbackHandler: callback response handler
-
array
$options: additional callback options
array
getDefaultButtonOptions
(string $panelID, string $buttonID)
-
string
$panelID: the unique ID of the container control
-
string
$buttonID: the unique ID of the button control
array
getPackagePathUrl
(string $base)
-
string
$base: javascript package path.
string
getPradoScriptAssetUrl
()
void
getRenderedScriptFiles
()
boolean
getRequiresHead
()
Returns the URLs of all script files referenced on the page
array
getScriptUrls
()
Returns the URLs of all stylesheet files referenced on the page
array
getStyleSheetUrls
()
boolean
hasBeginScripts
()
boolean
isBeginScriptRegistered
(string $key)
-
string
$key: a unique key
boolean
isEndScriptRegistered
(string $key)
-
string
$key: a unique key
boolean
isHeadScriptFileRegistered
(string $key)
-
string
$key: a unique key
boolean
isHeadScriptRegistered
(string $key)
-
string
$key: a unique key
boolean
isHiddenFieldRegistered
(string $key)
-
string
$key: a unique key
boolean
isScriptFileRegistered
(string $key)
-
string
$key: a unique key
boolean
isStyleSheetFileRegistered
(string $key)
-
string
$key: a unique key
boolean
isStyleSheetRegistered
(string $key)
-
string
$key: a unique key
void
markScriptFileAsRendered
( $url)
Registers a javascript script block at the beginning of the form
void
registerBeginScript
(string $key, string $script)
-
string
$key: a unique key identifying the script block
-
string
$script: javascript block
Registers callback javascript for a control.
void
registerCallbackControl
(string $class, array $options)
-
string
$class: javascript class responsible for the control being registered for callback
-
array
$options: callback options
Register a default button to panel. When the $panel is in focus and the 'enter' key is pressed, the $button will be clicked.
-
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
Registers a javascript script block at the end of the form
void
registerEndScript
(string $key, string $script)
-
string
$key: a unique key identifying the script block
-
string
$script: javascript block
Registers the control to receive default focus.
void
registerFocusControl
(string $target)
-
string
$target: the client ID of the control to receive default focus
Registers a javascript block in the page head.
void
registerHeadScript
(string $key, string $script)
-
string
$key: a unique key identifying the script block
-
string
$script: javascript block
Registers a javascript file in the page head
void
registerHeadScriptFile
(string $key, string $url)
-
string
$key: a unique key identifying the file
-
string
$url: URL to the javascript file
Registers a hidden field to be rendered in the form.
void
registerHiddenField
(string $name, string|array $value)
-
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.
Registers postback javascript for a control. A null class parameter will prevent the javascript code registration.
void
registerPostBackControl
(string $class, array $options)
-
string
$class: javascript class responsible for the control being registered for postback
-
array
$options: postback options
Registers Prado javascript by library name. See "Web/Javascripts/packages.php" for library names.
void
registerPradoScript
(string $name)
-
string
$name: script library name.
Registers a Prado javascript library to be loaded.
void
registerPradoScriptInternal
( $name)
Registers a javascript file to be rendered within the form
void
registerScriptFile
(string $key, string $url)
-
string
$key: a unique key identifying the file
-
string
$url: URL to the javascript file to be rendered
Registers a CSS block to be rendered in the page head
void
registerStyleSheet
(string $key, string $css, [ $media = ''])
-
string
$key: a unique key identifying the CSS block
-
string
$css: CSS block
-
$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);
}
}
?>
void
registerStyleSheetFile
(string $key, string $url, [string $media = ''])
-
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.
void
renderHiddenFieldsBegin
( $writer)
void
renderHiddenFieldsEnd
( $writer)
void
renderHiddenFieldsInt
(
THtmlWriter $writer,
$initial)
-
THtmlWriter
$writer: writer for the rendering purpose
-
$initial
void
renderScriptFiles
( $writer, $scripts)
void
renderScriptFilesBegin
( $writer)
void
renderScriptFilesEnd
( $writer)
Inherited Methods
Inherited From TApplicationComponent
TApplicationComponent::getApplication()
TApplicationComponent::getRequest()
TApplicationComponent::getResponse()
TApplicationComponent::getService()
TApplicationComponent::getSession()
TApplicationComponent::getUser()
TApplicationComponent::publishAsset()
TApplicationComponent::publishFilePath()
Inherited From TComponent
TComponent::addParsedObject()
TComponent::attachEventHandler()
TComponent::canGetProperty()
TComponent::canSetProperty()
TComponent::createdOnTemplate()
TComponent::detachEventHandler()
TComponent::evaluateExpression()
TComponent::evaluateStatements()
TComponent::getEventHandlers()
TComponent::getSubProperty()
TComponent::hasEvent()
TComponent::hasEventHandler()
TComponent::hasProperty()
TComponent::raiseEvent()
TComponent::setSubProperty()
TComponent::__call()
TComponent::__get()
TComponent::__set()
TComponent::__sleep()
TComponent::__wakeup()