PHP Класс 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
С версии: 3.1.1
Наследование: extends TWebControl, implements Prado\Web\UI\IPostBackDataHandler
Показать файл Открыть проект

Открытые методы

Метод Описание
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 )

Защищенные методы

Метод Описание
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.

Описание методов

activateView() защищенный Метод

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

addAttributesToRender() защищенный Метод

Adds attributes to renderer.
protected addAttributesToRender ( $writer )

addParsedObject() публичный Метод

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

createControlCollection() защищенный Метод

Creates a control collection object that is to be used to hold child controls
protected createControlCollection ( ) : TTabViewCollection
Результат TTabViewCollection control collection

getActiveTabCssClass() публичный Метод

public getActiveTabCssClass ( ) : string
Результат string CSS class for the active tab. Defaults to 'tab-active'.

getActiveTabStyle() публичный Метод

public getActiveTabStyle ( ) : TStyle
Результат TStyle the style for the active tab div

getActiveView() публичный Метод

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
Результат TTabView the currently active view, null if no active view

getActiveViewID() публичный Метод

Note, this property may not return the correct ID. To ensure the correctness, call {@link getActiveView()} first.
public getActiveViewID ( ) : string
Результат string The ID of the active tab view. Defaults to '', meaning not set.

getActiveViewIndex() публичный Метод

Note, this property may not return the correct index. To ensure the correctness, call {@link getActiveView()} first.
public getActiveViewIndex ( ) : integer
Результат 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 getAutoSwitch ( ) : boolean
Результат boolean status of automatic tab switch on hover

getClientClassName() защищенный Метод

This method overrides the parent implementation.
protected getClientClassName ( ) : string
Результат string the javascript class name

getClientOptions() защищенный Метод

protected getClientOptions ( ) : array
Результат array the options for JavaScript

getCssClass() публичный Метод

public getCssClass ( ) : string
Результат string CSS class for the whole tab control div. Defaults to 'tab-panel'.

getCssUrl() публичный Метод

public getCssUrl ( ) : string
Результат string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.

getDataChanged() публичный Метод

This method is required by the \Prado\Web\UI\IPostBackDataHandler interface.
public getDataChanged ( ) : boolean
Результат boolean whether postback has caused the control data change. False if the page is not in postback mode.

getTabCssClass() публичный Метод

public getTabCssClass ( ) : string
Результат string CSS class for non-active tabs. Defaults to 'tab-normal'.

getTabStyle() публичный Метод

public getTabStyle ( ) : TStyle
Результат TStyle the style for all the inactive tab div

getTagName() защищенный Метод

protected getTagName ( ) : string
Результат string tag name for the control

getViewCssClass() публичный Метод

public getViewCssClass ( ) : string
Результат string CSS class for the currently displayed view div. Defaults to 'tab-view'.

getViewStyle() публичный Метод

public getViewStyle ( ) : TStyle
Результат TStyle the style for all the view div

getViews() публичный Метод

public getViews ( ) : TTabViewCollection
Результат TTabViewCollection list of {@link TTabView} controls

loadPostData() публичный Метод

This method is primarly used by framework developers.
public loadPostData ( $key, $values ) : boolean
Результат boolean whether the data of the control has been changed

onPreRender() публичный Метод

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

raisePostDataChangedEvent() публичный Метод

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() защищенный Метод

Registers the relevant JavaScript.
protected registerClientScript ( )

registerStyleSheet() защищенный Метод

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 render ( $writer )

renderContents() публичный Метод

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

setActiveTabCssClass() публичный Метод

public setActiveTabCssClass ( $value )

setActiveView() публичный Метод

public setActiveView ( $view )

setActiveViewID() публичный Метод

public setActiveViewID ( $value )

setActiveViewIndex() публичный Метод

public setActiveViewIndex ( $value )

setAutoSwitch() публичный Метод

public setAutoSwitch ( $value )

setCssUrl() публичный Метод

public setCssUrl ( $value )

setTabCssClass() публичный Метод

public setTabCssClass ( $value )

setViewCssClass() публичный Метод

public setViewCssClass ( $value )