PHP Класс Prado\Web\UI\WebControls\TAccordion

TAccordion displays an accordion control. Users can click on the view headers to switch among different accordion views. Each accordion view is an independent panel that can contain arbitrary content. A TAccordion control consists of one or several {@link TAccordionView} controls representing the possible accordion views. At any time, only one accordion 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. TAccordion uses CSS to specify the appearance of the accordion headers 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 TAccordion: - {@link setCssClass CssClass} - the CSS class name for the outer-most div element (defaults to 'accordion'); - {@link setHeaderCssClass HeaderCssClass} - the CSS class name for nonactive accordion div elements (defaults to 'accordion-header'); - {@link setActiveHeaderCssClass ActiveHeaderCssClass} - the CSS class name for the active accordion div element (defaults to 'accordion-header-active'); - {@link setViewCssClass ViewCssClass} - the CSS class for the div element enclosing view content (defaults to 'accordion-view'); When the user clicks on a view header, the switch between the old visible view and the clicked one is animated. You can use the {@link setAnimationDuration AnimationDuration} property to set the animation length in seconds; it defaults to 1 second, and when set to 0 it will produce an immediate switch with no animation. The TAccordion auto-sizes itself to the largest of all views, so it can encompass all of them without scrolling. If you want to specify a fixed height (in pixels), use the {@link setViewHeight ViewHeight} property. When a TAccordion is nested inside another, it's adviced to manually specify a {@link setViewHeight ViewHeight} for the internal TAccordion To use TAccordion, write a template like following: content for view 1 content for view 2 content for view 3
С версии: 3.2
Автор: Gabor Berczi, DevWorx Hungary ([email protected])
Наследование: extends TWebControl, implements Prado\Web\UI\IPostBackDataHandler
Показать файл Открыть проект

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

Метод Описание
addParsedObject ( $object ) Adds object parsed from template to the control.
getActiveHeaderCssClass ( ) : string
getActiveHeaderStyle ( ) : TStyle
getActiveView ( ) : TAccordionView Returns the currently active view.
getActiveViewID ( ) : string Returns the ID of the active accordion view.
getActiveViewIndex ( ) : integer Returns the index of the active accordion view.
getAnimationDuration ( ) : string
getCssClass ( ) : string
getCssUrl ( ) : string
getDataChanged ( ) : boolean Returns a value indicating whether postback has caused the control data change.
getHeaderCssClass ( ) : string
getHeaderStyle ( ) : TStyle
getViewCssClass ( ) : string
getViewHeight ( ) : integer
getViewStyle ( ) : TStyle
getViews ( ) : TAccordionViewCollection
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 accordion control.
setActiveHeaderCssClass ( $value )
setActiveView ( $view )
setActiveViewID ( $value )
setActiveViewIndex ( $value )
setAnimationDuration ( $value )
setCssUrl ( $value )
setHeaderCssClass ( $value )
setViewCssClass ( $value )
setViewHeight ( $value )

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

Метод Описание
activateView ( $view ) Activates the specified view.
addAttributesToRender ( $writer ) Adds attributes to renderer.
createControlCollection ( ) : TAccordionViewCollection 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 TAccordion.

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

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 TAccordionView} 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 ( ) : TAccordionViewCollection
Результат TAccordionViewCollection control collection

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

public getActiveHeaderCssClass ( ) : string
Результат string Extra CSS class for the active header. Defaults to 'accordion-header-active'.

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

public getActiveHeaderStyle ( ) : TStyle
Результат TStyle the style for the active header 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 ( ) : TAccordionView
Результат TAccordionView 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 accordion 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 accordion view. If -1, it means no active accordion view. Default is 0 (the first view is active).

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

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

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 accordion control div.

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.

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

public getHeaderCssClass ( ) : string
Результат string CSS class for view headers. Defaults to 'accordion-header'.

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

public getHeaderStyle ( ) : TStyle
Результат TStyle the style for all the inactive header 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 'accordion-view'.

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

public getViewHeight ( ) : integer
Результат integer Maximum height for the accordion views. If non specified, the accordion will auto-sized to the largest of all views, so it can encompass all of them without scrolling

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

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

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

public getViews ( ) : TAccordionViewCollection
Результат TAccordionViewCollection list of {@link TAccordionView} 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 accordion control.
public renderContents ( $writer )

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

public setActiveHeaderCssClass ( $value )

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

public setActiveView ( $view )

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

public setActiveViewID ( $value )

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

public setActiveViewIndex ( $value )

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

public setAnimationDuration ( $value )

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

public setCssUrl ( $value )

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

public setHeaderCssClass ( $value )

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

public setViewCssClass ( $value )

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

public setViewHeight ( $value )