PHP Class Prado\Web\UI\WebControls\TTabPanel

TTabPanel displays a tabbed panel. Users can click on the tab bar to switching among different tab views. Each tab view is an independent panel that can contain arbitrary content. If the {@link setAutoSwitch AutoSwitch} property is enabled, the user will be able to switch the active view to another one just hovering its corresponding tab caption. A TTabPanel control consists of one or several {@link TTabView} controls representing the possible tab views. At any time, only one tab view is visible (active), which is specified by any of the following properties: - {@link setActiveViewIndex ActiveViewIndex} - the zero-based integer index of the view in the view collection. - {@link setActiveViewID ActiveViewID} - the text ID of the visible view. - {@link setActiveView ActiveView} - the visible view instance. If both {@link setActiveViewIndex ActiveViewIndex} and {@link setActiveViewID ActiveViewID} are set, the latter takes precedence. TTabPanel uses CSS to specify the appearance of the tab bar and panel. By default, an embedded CSS file will be published which contains the default CSS for TTabPanel. You may also use your own CSS file by specifying the {@link setCssUrl CssUrl} property. The following properties specify the CSS classes used for elements in a TTabPanel: - {@link setCssClass CssClass} - the CSS class name for the outer-most div element (defaults to 'tab-panel'); - {@link setTabCssClass TabCssClass} - the CSS class name for nonactive tab div elements (defaults to 'tab-normal'); - {@link setActiveTabCssClass ActiveTabCssClass} - the CSS class name for the active tab div element (defaults to 'tab-active'); - {@link setViewCssClass ViewCssClass} - the CSS class for the div element enclosing view content (defaults to 'tab-view'); To use TTabPanel, write a template like following: content for view 1 content for view 2 content for view 3
Since: 3.1.1
Inheritance: extends TWebControl, implements Prado\Web\UI\IPostBackDataHandler
Afficher le fichier Open project: pradosoft/prado

Méthodes publiques

Méthode Description
addParsedObject ( $object ) Adds object parsed from template to the control.
getActiveTabCssClass ( ) : string
getActiveTabStyle ( ) : TStyle
getActiveView ( ) : TTabView Returns the currently active view.
getActiveViewID ( ) : string Returns the ID of the active tab view.
getActiveViewIndex ( ) : integer Returns the index of the active tab view.
getAutoSwitch ( ) : boolean
getCssClass ( ) : string
getCssUrl ( ) : string
getDataChanged ( ) : boolean Returns a value indicating whether postback has caused the control data change.
getTabCssClass ( ) : string
getTabStyle ( ) : TStyle
getViewCssClass ( ) : string
getViewStyle ( ) : TStyle
getViews ( ) : TTabViewCollection
loadPostData ( $key, $values ) : boolean Loads user input data.
onPreRender ( $param ) Registers CSS and JS.
raisePostDataChangedEvent ( ) Raises postdata changed event.
render ( $writer )
renderContents ( $writer ) Renders body contents of the tab control.
setActiveTabCssClass ( $value )
setActiveView ( $view )
setActiveViewID ( $value )
setActiveViewIndex ( $value )
setAutoSwitch ( $value )
setCssUrl ( $value )
setTabCssClass ( $value )
setViewCssClass ( $value )

Méthodes protégées

Méthode Description
activateView ( $view ) Activates the specified view.
addAttributesToRender ( $writer ) Adds attributes to renderer.
createControlCollection ( ) : TTabViewCollection Creates a control collection object that is to be used to hold child controls
getClientClassName ( ) : string Gets the name of the javascript class responsible for performing postback for this control.
getClientOptions ( ) : array
getTagName ( ) : string
registerClientScript ( ) Registers the relevant JavaScript.
registerStyleSheet ( ) Registers the CSS relevant to the TTabControl.

Method Details

activateView() protected méthode

If there is any other view currently active, it will be deactivated.
protected activateView ( $view )

addAttributesToRender() protected méthode

Adds attributes to renderer.
protected addAttributesToRender ( $writer )

addParsedObject() public méthode

This method adds only {@link TTabView} objects into the {@link getViews Views} collection. All other objects are ignored.
public addParsedObject ( $object )

createControlCollection() protected méthode

Creates a control collection object that is to be used to hold child controls
protected createControlCollection ( ) : TTabViewCollection
Résultat TTabViewCollection control collection

getActiveTabCssClass() public méthode

public getActiveTabCssClass ( ) : string
Résultat string CSS class for the active tab. Defaults to 'tab-active'.

getActiveTabStyle() public méthode

public getActiveTabStyle ( ) : TStyle
Résultat TStyle the style for the active tab div

getActiveView() public méthode

This method will examin the ActiveViewID, ActiveViewIndex and Views collection to determine which view is currently active. It will update ActiveViewID and ActiveViewIndex accordingly.
public getActiveView ( ) : TTabView
Résultat TTabView the currently active view, null if no active view

getActiveViewID() public méthode

Note, this property may not return the correct ID. To ensure the correctness, call {@link getActiveView()} first.
public getActiveViewID ( ) : string
Résultat string The ID of the active tab view. Defaults to '', meaning not set.

getActiveViewIndex() public méthode

Note, this property may not return the correct index. To ensure the correctness, call {@link getActiveView()} first.
public getActiveViewIndex ( ) : integer
Résultat integer the zero-based index of the active tab view. If -1, it means no active tab view. Default is 0 (the first view is active).

getAutoSwitch() public méthode

public getAutoSwitch ( ) : boolean
Résultat boolean status of automatic tab switch on hover

getClientClassName() protected méthode

This method overrides the parent implementation.
protected getClientClassName ( ) : string
Résultat string the javascript class name

getClientOptions() protected méthode

protected getClientOptions ( ) : array
Résultat array the options for JavaScript

getCssClass() public méthode

public getCssClass ( ) : string
Résultat string CSS class for the whole tab control div. Defaults to 'tab-panel'.

getCssUrl() public méthode

public getCssUrl ( ) : string
Résultat string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.

getDataChanged() public méthode

This method is required by the \Prado\Web\UI\IPostBackDataHandler interface.
public getDataChanged ( ) : boolean
Résultat boolean whether postback has caused the control data change. False if the page is not in postback mode.

getTabCssClass() public méthode

public getTabCssClass ( ) : string
Résultat string CSS class for non-active tabs. Defaults to 'tab-normal'.

getTabStyle() public méthode

public getTabStyle ( ) : TStyle
Résultat TStyle the style for all the inactive tab div

getTagName() protected méthode

protected getTagName ( ) : string
Résultat string tag name for the control

getViewCssClass() public méthode

public getViewCssClass ( ) : string
Résultat string CSS class for the currently displayed view div. Defaults to 'tab-view'.

getViewStyle() public méthode

public getViewStyle ( ) : TStyle
Résultat TStyle the style for all the view div

getViews() public méthode

public getViews ( ) : TTabViewCollection
Résultat TTabViewCollection list of {@link TTabView} controls

loadPostData() public méthode

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
Résultat boolean whether the data of the control has been changed

onPreRender() public méthode

This method is invoked right before the control rendering, if the control is visible.
public onPreRender ( $param )

raisePostDataChangedEvent() public méthode

This method is required by {@link \Prado\Web\UI\IPostBackDataHandler} interface. It is invoked by the framework when {@link getActiveViewIndex ActiveViewIndex} property is changed on postback. This method is primarly used by framework developers.

registerClientScript() protected méthode

Registers the relevant JavaScript.
protected registerClientScript ( )

registerStyleSheet() protected méthode

It will register the CSS file specified by {@link getCssUrl CssUrl}. If that is not set, it will use the default CSS.
protected registerStyleSheet ( )

render() public méthode

public render ( $writer )

renderContents() public méthode

Renders body contents of the tab control.
public renderContents ( $writer )

setActiveTabCssClass() public méthode

public setActiveTabCssClass ( $value )

setActiveView() public méthode

public setActiveView ( $view )

setActiveViewID() public méthode

public setActiveViewID ( $value )

setActiveViewIndex() public méthode

public setActiveViewIndex ( $value )

setAutoSwitch() public méthode

public setAutoSwitch ( $value )

setCssUrl() public méthode

public setCssUrl ( $value )

setTabCssClass() public méthode

public setTabCssClass ( $value )

setViewCssClass() public méthode

public setViewCssClass ( $value )