PHP Class Prado\Web\UI\TPage

Since: 3.0
Author: Qiang Xue ([email protected])
Inheritance: extends TTemplateControl
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Protected Properties

Свойство Type Description
$_controlsPostDataChanged list of controls whose data have been changed due to the postback
$_controlsRegisteredForPostData list of controls that need to load post data in the next postback
$_controlsRequiringPostData list of controls that need to load post data in the current request
$_formRendered whether the form has been rendered
$_inFormRender whether the current rendering is within a form
$_isLoadingPostData true if loading post data.
$_postData data post back by user
$_restPostData postback data that is not handled during first invocation of LoadPostData.

Méthodes publiques

Méthode Description
__construct ( ) Constructor.
applyControlSkin ( $control ) Applies a skin in the current theme to a control.
applyControlStyleSheet ( $control ) Applies a stylesheet skin in the current theme to a control.
beginFormRender ( $writer )
endFormRender ( $writer )
ensureRenderInForm ( $control ) Ensures the control is rendered within a form.
flushWriter ( ) Flushes output
getCachingStack ( ) : TStack
getCallbackClient ( ) : TCallbackClientScript Gets the callback client script handler that allows javascript functions to be executed during the callback response.
getCallbackEventParameter ( ) : string Callback parameter is decoded assuming JSON encoding.
getCallbackEventTarget ( ) : TControl
getClientScript ( ) : TClientScriptManager
getClientState ( ) : string Returns the state to be stored on the client side.
getClientSupportsJavaScript ( ) : boolean
getEnableStateCompression ( ) : boolean
getEnableStateEncryption ( ) : boolean
getEnableStateValidation ( ) : boolean
getForm ( ) : TForm
getHead ( ) : THead
getInFormRender ( ) : boolean
getIsCallback ( ) : boolean
getIsLoadingPostData ( ) : boolean
getIsPostBack ( ) : boolean
getIsValid ( ) : boolean Returns whether user input is valid or not.
getPagePath ( ) : string
getPostBackEventParameter ( ) : string
getPostBackEventTarget ( ) : TControl
getRequestClientState ( ) : string
getStatePersister ( ) : Prado\Web\UI\IPageStatePersister
getStatePersisterClass ( ) : string
getStyleSheetTheme ( ) : TTheme
getTheme ( ) : TTheme
getTitle ( ) : string
getValidators ( $validationGroup = null ) : Prado\Collections\TList Returns a list of registered validators.
loadState ( ) This method is invoked right after the control has loaded its state.
onInitComplete ( $param ) Raises OnInitComplete event.
onLoadComplete ( $param ) Raises OnLoadComplete event.
onPreInit ( $param ) Raises OnPreInit event.
onPreLoad ( $param ) Raises OnPreLoad event.
onPreRenderComplete ( $param ) Raises OnPreRenderComplete event.
onSaveStateComplete ( $param ) Raises OnSaveStateComplete event.
registerCachingAction ( $context, $funcName, $funcParams ) Registers an action associated with the content being cached.
registerRequiresPostData ( $control ) Registers a control for loading post data in the next postback.
run ( $writer ) Runs through the page lifecycles.
saveState ( ) This method is invoked when control state is to be saved.
setCallbackClient ( $client ) Set a new callback client handler.
setCallbackEventParameter ( $value )
setCallbackEventTarget ( TControl $control ) Registers a control to raise callback event in the current request.
setClientState ( $state ) Sets the state to be stored on the client side.
setClientSupportsJavaScript ( $value )
setEnableStateCompression ( $value )
setEnableStateEncryption ( $value )
setEnableStateValidation ( $value )
setFocus ( $value ) Sets input focus on a control after the page is rendered to users.
setForm ( TForm $form ) Registers a TForm instance to the page.
setHead ( THead $value )
setPagePath ( $value )
setPostBackEventParameter ( $value )
setPostBackEventTarget ( TControl $control ) Registers a control to raise postback event in the current request.
setStatePersisterClass ( $value )
setStyleSheetTheme ( $value ) Sets the stylesheet theme to be used for the page.
setTheme ( $value ) Sets the theme to be used for the page.
setTitle ( $value ) Sets the page title.
validate ( $validationGroup = null ) Performs input validation.

Méthodes protégées

Méthode Description
decodeUTF8 ( $data, $enc )
isSystemPostField ( $field ) : boolean
loadPageState ( ) Loads page state from persistent storage.
processCallbackRequest ( $writer ) Sets Adapter to TActivePageAdapter and calls apter to process the callback request.
processNormalRequest ( $writer )
processPostBackRequest ( $writer )
processPostData ( $postData, $beforeLoad ) Processes post data.
raiseChangedEvents ( ) Raises OnPostDataChangedEvent for controls whose data have been changed due to the postback.
raisePostBackEvent ( ) Raises PostBack event.
savePageState ( ) Saves page state from persistent storage.

Private Methods

Méthode Description
determinePostBackMode ( ) Determines whether the current page request is a postback.
getCssMediaType ( $url ) : string Determines the media type of the CSS file.

Method Details

__construct() public méthode

Sets the page object to itself. Derived classes must call parent implementation.
public __construct ( )

applyControlSkin() public méthode

This method should only be used by framework developers.
public applyControlSkin ( $control )

applyControlStyleSheet() public méthode

This method should only be used by framework developers.
public applyControlStyleSheet ( $control )

beginFormRender() public méthode

public beginFormRender ( $writer )

decodeUTF8() protected static méthode

protected static decodeUTF8 ( $data, $enc )

endFormRender() public méthode

public endFormRender ( $writer )

ensureRenderInForm() public méthode

Ensures the control is rendered within a form.
public ensureRenderInForm ( $control )

flushWriter() public méthode

Flushes output
public flushWriter ( )

getCachingStack() public méthode

public getCachingStack ( ) : TStack
Résultat Prado\Collections\TStack stack of {@link TOutputCache} objects

getCallbackClient() public méthode

Gets the callback client script handler that allows javascript functions to be executed during the callback response.
public getCallbackClient ( ) : TCallbackClientScript
Résultat Prado\Web\UI\ActiveControls\TCallbackClientScript interface to client-side javascript code.

getCallbackEventParameter() public méthode

Callback parameter is decoded assuming JSON encoding.
public getCallbackEventParameter ( ) : string
Résultat string callback event parameter

getCallbackEventTarget() public méthode

public getCallbackEventTarget ( ) : TControl
Résultat TControl the control responsible for the current callback event, null if nonexistent

getClientScript() public méthode

public getClientScript ( ) : TClientScriptManager
Résultat TClientScriptManager client script manager

getClientState() public méthode

This method should only be used by framework and control developers.
public getClientState ( ) : string
Résultat string the state to be stored on the client side

getClientSupportsJavaScript() public méthode

public getClientSupportsJavaScript ( ) : boolean
Résultat boolean whether client supports javascript. Defaults to true.

getEnableStateCompression() public méthode

Since: 3.1.6
public getEnableStateCompression ( ) : boolean
Résultat boolean whether page state should be compressed. Defaults to true.

getEnableStateEncryption() public méthode

public getEnableStateEncryption ( ) : boolean
Résultat boolean whether page state should be encrypted. Defaults to false.

getEnableStateValidation() public méthode

public getEnableStateValidation ( ) : boolean
Résultat boolean whether page state should be HMAC validated. Defaults to true.

getForm() public méthode

public getForm ( ) : TForm
Résultat TForm the form on the page

getHead() public méthode

public getHead ( ) : THead
Résultat Prado\Web\UI\WebControls\THead page head, null if not available

getInFormRender() public méthode

public getInFormRender ( ) : boolean
Résultat boolean Whether form rendering is in progress

getIsCallback() public méthode

public getIsCallback ( ) : boolean
Résultat boolean whether this is a callback request

getIsLoadingPostData() public méthode

public getIsLoadingPostData ( ) : boolean
Résultat boolean true if loading post data.

getIsPostBack() public méthode

public getIsPostBack ( ) : boolean
Résultat boolean whether the current page request is a postback

getIsValid() public méthode

This method must be invoked after {@link validate} is called.
public getIsValid ( ) : boolean
Résultat boolean whether the user input is valid or not.

getPagePath() public méthode

public getPagePath ( ) : string
Résultat string the requested page path for this page

getPostBackEventParameter() public méthode

public getPostBackEventParameter ( ) : string
Résultat string postback event parameter

getPostBackEventTarget() public méthode

public getPostBackEventTarget ( ) : TControl
Résultat TControl the control responsible for the current postback event, null if nonexistent

getRequestClientState() public méthode

public getRequestClientState ( ) : string
Résultat string the state postback from client side

getStatePersister() public méthode

public getStatePersister ( ) : Prado\Web\UI\IPageStatePersister
Résultat Prado\Web\UI\IPageStatePersister page state persister

getStatePersisterClass() public méthode

public getStatePersisterClass ( ) : string
Résultat string class name of the page state persister. Defaults to TPageStatePersister.

getStyleSheetTheme() public méthode

public getStyleSheetTheme ( ) : TTheme
Résultat TTheme the stylesheet theme used for the page. Defaults to null.

getTheme() public méthode

public getTheme ( ) : TTheme
Résultat TTheme the theme used for the page. Defaults to null.

getTitle() public méthode

public getTitle ( ) : string
Résultat string page title.

getValidators() public méthode

If validation group is specified, only the validators in that group will be returned.
public getValidators ( $validationGroup = null ) : Prado\Collections\TList
Résultat Prado\Collections\TList registered validators in the requested group. If the group is null, all validators will be returned.

isSystemPostField() protected méthode

protected isSystemPostField ( $field ) : boolean
Résultat boolean whether the specified field is a system field in postback data

loadPageState() protected méthode

Loads page state from persistent storage.
protected loadPageState ( )

loadState() public méthode

You can override this method to initialize data from the control state. Parent implementation must be invoked.
public loadState ( )

onInitComplete() public méthode

This method is invoked right after {@link onInit OnInit} stage and before {@link onLoad OnLoad} stage. You may override this method to provide additional initialization that should be done after {@link onInit OnInit}. Remember to call the parent implementation to ensure OnInitComplete event is raised.
public onInitComplete ( $param )

onLoadComplete() public méthode

This method is invoked right after {@link onLoad OnLoad} stage. You may override this method to provide additional page loading logic that should be done after {@link onLoad OnLoad}. Remember to call the parent implementation to ensure OnLoadComplete event is raised.
public onLoadComplete ( $param )

onPreInit() public méthode

This method is invoked right before {@link onInit OnInit} stage. You may override this method to provide additional initialization that should be done before {@link onInit OnInit} (e.g. setting {@link setTheme Theme} or {@link setStyleSheetTheme StyleSheetTheme}). Remember to call the parent implementation to ensure OnPreInit event is raised.
public onPreInit ( $param )

onPreLoad() public méthode

This method is invoked right before {@link onLoad OnLoad} stage. You may override this method to provide additional page loading logic that should be done before {@link onLoad OnLoad}. Remember to call the parent implementation to ensure OnPreLoad event is raised.
public onPreLoad ( $param )

onPreRenderComplete() public méthode

This method is invoked right after {@link onPreRender OnPreRender} stage. You may override this method to provide additional preparation for page rendering that should be done after {@link onPreRender OnPreRender}. Remember to call the parent implementation to ensure OnPreRenderComplete event is raised.
public onPreRenderComplete ( $param )

onSaveStateComplete() public méthode

This method is invoked right after {@link onSaveState OnSaveState} stage. You may override this method to provide additional logic after page state is saved. Remember to call the parent implementation to ensure OnSaveStateComplete event is raised.
public onSaveStateComplete ( $param )

processCallbackRequest() protected méthode

Sets Adapter to TActivePageAdapter and calls apter to process the callback request.
protected processCallbackRequest ( $writer )

processNormalRequest() protected méthode

protected processNormalRequest ( $writer )

processPostBackRequest() protected méthode

protected processPostBackRequest ( $writer )

processPostData() protected méthode

Processes post data.
protected processPostData ( $postData, $beforeLoad )

raiseChangedEvents() protected méthode

Raises OnPostDataChangedEvent for controls whose data have been changed due to the postback.
protected raiseChangedEvents ( )

raisePostBackEvent() protected méthode

Raises PostBack event.
protected raisePostBackEvent ( )

registerCachingAction() public méthode

The registered action will be replayed if the content stored in the cache is served to end-users.
public registerCachingAction ( $context, $funcName, $funcParams )

registerRequiresPostData() public méthode

This method needs to be invoked if the control to load post data may not have a post variable in some cases. For example, a checkbox, if not checked, will not have a post value.
public registerRequiresPostData ( $control )

run() public méthode

Runs through the page lifecycles.
public run ( $writer )

savePageState() protected méthode

Saves page state from persistent storage.
protected savePageState ( )

saveState() public méthode

You can override this method to do last step state saving. Parent implementation must be invoked.
public saveState ( )

setCallbackClient() public méthode

Set a new callback client handler.
public setCallbackClient ( $client )

setCallbackEventParameter() public méthode

public setCallbackEventParameter ( $value )

setCallbackEventTarget() public méthode

Registers a control to raise callback event in the current request.
public setCallbackEventTarget ( TControl $control )
$control TControl

setClientState() public méthode

This method should only be used by framework and control developers.
public setClientState ( $state )

setClientSupportsJavaScript() public méthode

public setClientSupportsJavaScript ( $value )

setEnableStateCompression() public méthode

Since: 3.1.6
public setEnableStateCompression ( $value )

setEnableStateEncryption() public méthode

public setEnableStateEncryption ( $value )

setEnableStateValidation() public méthode

public setEnableStateValidation ( $value )

setFocus() public méthode

Sets input focus on a control after the page is rendered to users.
public setFocus ( $value )

setForm() public méthode

Note, a page can contain at most one TForm instance.
public setForm ( TForm $form )
$form TForm

setHead() public méthode

public setHead ( THead $value )
$value Prado\Web\UI\WebControls\THead

setPagePath() public méthode

public setPagePath ( $value )

setPostBackEventParameter() public méthode

public setPostBackEventParameter ( $value )

setPostBackEventTarget() public méthode

Registers a control to raise postback event in the current request.
public setPostBackEventTarget ( TControl $control )
$control TControl

setStatePersisterClass() public méthode

public setStatePersisterClass ( $value )

setStyleSheetTheme() public méthode

Sets the stylesheet theme to be used for the page.
public setStyleSheetTheme ( $value )

setTheme() public méthode

Sets the theme to be used for the page.
public setTheme ( $value )

setTitle() public méthode

Note, a {@link THead} control needs to place on the page in order that this title be rendered.
public setTitle ( $value )

validate() public méthode

This method will invoke the registered validators to perform the actual validation. If validation group is specified, only the validators in that group will be invoked.
public validate ( $validationGroup = null )

Property Details

$_controlsPostDataChanged protected_oe property

list of controls whose data have been changed due to the postback
protected $_controlsPostDataChanged

$_controlsRegisteredForPostData protected_oe property

list of controls that need to load post data in the next postback
protected $_controlsRegisteredForPostData

$_controlsRequiringPostData protected_oe property

list of controls that need to load post data in the current request
protected $_controlsRequiringPostData

$_formRendered protected_oe property

whether the form has been rendered
protected $_formRendered

$_inFormRender protected_oe property

whether the current rendering is within a form
protected $_inFormRender

$_isLoadingPostData protected_oe property

true if loading post data.
protected $_isLoadingPostData

$_postData protected_oe property

data post back by user
protected $_postData

$_restPostData protected_oe property

postback data that is not handled during first invocation of LoadPostData.
protected $_restPostData