PHP 클래스 yii\bootstrap\Tabs

For example: php echo Tabs::widget([ 'items' => [ [ 'label' => 'One', 'content' => 'Anim pariatur cliche...', 'active' => true ], [ 'label' => 'Two', 'content' => 'Anim pariatur cliche...', 'headerOptions' => [...], 'options' => ['id' => 'myveryownID'], ], [ 'label' => 'Example', 'url' => 'http://www.example.com', ], [ 'label' => 'Dropdown', 'items' => [ [ 'label' => 'DropdownA', 'content' => 'DropdownA, Anim pariatur cliche...', ], [ 'label' => 'DropdownB', 'content' => 'DropdownB, Anim pariatur cliche...', ], [ 'label' => 'External Link', 'url' => 'http://www.example.com', ], ], ], ], ]);
또한 보기: http://getbootstrap.com/javascript/#tabs
부터: 2.0
저자: Antonio Ramirez ([email protected])
상속: extends yii\bootstrap\Widget
파일 보기 프로젝트 열기: yiisoft/yii2-bootstrap 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$dropdownClass name of a class to use for rendering dropdowns withing this widget. Defaults to Dropdown.
$encodeLabels whether the labels for header items should be HTML-encoded.
$headerOptions list of HTML attributes for the header container tags. This will be overwritten by the "headerOptions" set in individual [[items]].
$itemOptions list of HTML attributes for the item container tags. This will be overwritten by the "options" set in individual [[items]]. The following special options are recognized: - tag: string, defaults to "div", the tag name of the item container tags.
$items list of tabs in the tabs widget. Each array element represents a single tab with the following structure: - label: string, required, the tab header label. - encode: boolean, optional, whether this label should be HTML-encoded. This param will override global $this->encodeLabels param. - headerOptions: array, optional, the HTML attributes of the tab header. - linkOptions: array, optional, the HTML attributes of the tab header link tags. - content: string, optional, the content (HTML) of the tab pane. - url: string, optional, an external URL. When this is specified, clicking on this tab will bring the browser to this URL. This option is available since version 2.0.4. - options: array, optional, the HTML attributes of the tab pane container. - active: boolean, optional, whether this item tab header and pane should be active. If no item is marked as 'active' explicitly - the first one will be activated. - visible: boolean, optional, whether the item tab header and pane should be visible or not. Defaults to true. - items: array, optional, can be used instead of content to specify a dropdown items configuration array. Each item can hold three extra keys, besides the above ones: * active: boolean, optional, whether the item tab header and pane should be visible or not. * content: string, required if items is not set. The content (HTML) of the tab pane. * contentOptions: optional, array, the HTML attributes of the tab content container.
$linkOptions list of HTML attributes for the tab header link tags. This will be overwritten by the "linkOptions" set in individual [[items]].
$navType specifies the Bootstrap tab styling.
$renderTabContent whether to render the tab-content container and its content. You may set this property to be false so that you can manually render tab-content yourself in case your tab contents are complex.

공개 메소드들

메소드 설명
init ( ) Initializes the widget.
run ( ) Renders the widget.

보호된 메소드들

메소드 설명
hasActiveTab ( ) : boolean
renderDropdown ( string $itemNumber, array &$items, array &$panes ) : boolean Normalizes dropdown item options by removing tab specific keys content and contentOptions, and also configure panes accordingly.
renderItems ( ) : string Renders tab items as specified on [[items]].

메소드 상세

hasActiveTab() 보호된 메소드

protected hasActiveTab ( ) : boolean
리턴 boolean if there's active tab defined

init() 공개 메소드

Initializes the widget.
public init ( )

renderDropdown() 보호된 메소드

Normalizes dropdown item options by removing tab specific keys content and contentOptions, and also configure panes accordingly.
protected renderDropdown ( string $itemNumber, array &$items, array &$panes ) : boolean
$itemNumber string number of the item
$items array the dropdown items configuration.
$panes array the panes reference array.
리턴 boolean whether any of the dropdown items is `active` or not.

renderItems() 보호된 메소드

Renders tab items as specified on [[items]].
protected renderItems ( ) : string
리턴 string the rendering result.

run() 공개 메소드

Renders the widget.
public run ( )

프로퍼티 상세

$dropdownClass 공개적으로 프로퍼티

name of a class to use for rendering dropdowns withing this widget. Defaults to Dropdown.
부터: 2.0.7
public $dropdownClass

$encodeLabels 공개적으로 프로퍼티

whether the labels for header items should be HTML-encoded.
public $encodeLabels

$headerOptions 공개적으로 프로퍼티

list of HTML attributes for the header container tags. This will be overwritten by the "headerOptions" set in individual [[items]].
또한 보기: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $headerOptions

$itemOptions 공개적으로 프로퍼티

list of HTML attributes for the item container tags. This will be overwritten by the "options" set in individual [[items]]. The following special options are recognized: - tag: string, defaults to "div", the tag name of the item container tags.
또한 보기: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $itemOptions

$items 공개적으로 프로퍼티

list of tabs in the tabs widget. Each array element represents a single tab with the following structure: - label: string, required, the tab header label. - encode: boolean, optional, whether this label should be HTML-encoded. This param will override global $this->encodeLabels param. - headerOptions: array, optional, the HTML attributes of the tab header. - linkOptions: array, optional, the HTML attributes of the tab header link tags. - content: string, optional, the content (HTML) of the tab pane. - url: string, optional, an external URL. When this is specified, clicking on this tab will bring the browser to this URL. This option is available since version 2.0.4. - options: array, optional, the HTML attributes of the tab pane container. - active: boolean, optional, whether this item tab header and pane should be active. If no item is marked as 'active' explicitly - the first one will be activated. - visible: boolean, optional, whether the item tab header and pane should be visible or not. Defaults to true. - items: array, optional, can be used instead of content to specify a dropdown items configuration array. Each item can hold three extra keys, besides the above ones: * active: boolean, optional, whether the item tab header and pane should be visible or not. * content: string, required if items is not set. The content (HTML) of the tab pane. * contentOptions: optional, array, the HTML attributes of the tab content container.
public $items

$linkOptions 공개적으로 프로퍼티

list of HTML attributes for the tab header link tags. This will be overwritten by the "linkOptions" set in individual [[items]].
또한 보기: yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered.
public $linkOptions

$navType 공개적으로 프로퍼티

specifies the Bootstrap tab styling.
public $navType

$renderTabContent 공개적으로 프로퍼티

whether to render the tab-content container and its content. You may set this property to be false so that you can manually render tab-content yourself in case your tab contents are complex.
부터: 2.0.1
public $renderTabContent