PHP 클래스 yii\bootstrap\Collapse

For example: php echo Collapse::widget([ 'items' => [ equivalent to the above [ 'label' => 'Collapsible Group Item #1', 'content' => 'Anim pariatur cliche...', open its content by default 'contentOptions' => ['class' => 'in'] ], another group item [ 'label' => 'Collapsible Group Item #1', 'content' => 'Anim pariatur cliche...', 'contentOptions' => [...], 'options' => [...], ], if you want to swap out .panel-body with .list-group, you may use the following [ 'label' => 'Collapsible Group Item #1', 'content' => [ 'Anim pariatur cliche...', 'Anim pariatur cliche...' ], 'contentOptions' => [...], 'options' => [...], 'footer' => 'Footer' // the footer label in list-group ], ] ]);
또한 보기: http://getbootstrap.com/javascript/#collapse
부터: 2.0
저자: Antonio Ramirez ([email protected])
상속: extends yii\bootstrap\Widget
파일 보기 프로젝트 열기: yiisoft/yii2-bootstrap 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$encodeLabels whether the labels for header items should be HTML-encoded.
$items list of groups in the collapse widget. Each array element represents a single group with the following structure: - label: string, required, the group header label. - encode: boolean, optional, whether this label should be HTML-encoded. This param will override global $this->encodeLabels param. - content: array|string|object, required, the content (HTML) of the group - options: array, optional, the HTML attributes of the group - contentOptions: optional, the HTML attributes of the group's content

공개 메소드들

메소드 설명
init ( ) Initializes the widget.
renderItem ( string $header, array $item, integer $index ) : string Renders a single collapsible item group
renderItems ( ) : string Renders collapsible items as specified on [[items]].
run ( ) Renders the widget.

메소드 상세

init() 공개 메소드

Initializes the widget.
public init ( )

renderItem() 공개 메소드

Renders a single collapsible item group
public renderItem ( string $header, array $item, integer $index ) : string
$header string a label of the item group [[items]]
$item array a single item from [[items]]
$index integer the item index as each item group content must have an id
리턴 string the rendering result

renderItems() 공개 메소드

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

run() 공개 메소드

Renders the widget.
public run ( )

프로퍼티 상세

$encodeLabels 공개적으로 프로퍼티

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

$items 공개적으로 프로퍼티

list of groups in the collapse widget. Each array element represents a single group with the following structure: - label: string, required, the group header label. - encode: boolean, optional, whether this label should be HTML-encoded. This param will override global $this->encodeLabels param. - content: array|string|object, required, the content (HTML) of the group - options: array, optional, the HTML attributes of the group - contentOptions: optional, the HTML attributes of the group's content
public $items