|
|
@ -94,7 +94,7 @@ class Collapse extends Widget |
|
|
|
$items = []; |
|
|
|
$items = []; |
|
|
|
$index = 0; |
|
|
|
$index = 0; |
|
|
|
foreach ($this->items as $item) { |
|
|
|
foreach ($this->items as $item) { |
|
|
|
if (!isset($item['label'])) { |
|
|
|
if (!array_key_exists('label', $item)) { |
|
|
|
throw new InvalidConfigException("The 'label' option is required."); |
|
|
|
throw new InvalidConfigException("The 'label' option is required."); |
|
|
|
} |
|
|
|
} |
|
|
|
$header = $item['label']; |
|
|
|
$header = $item['label']; |
|
|
@ -116,7 +116,7 @@ class Collapse extends Widget |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function renderItem($header, $item, $index) |
|
|
|
public function renderItem($header, $item, $index) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (isset($item['content'])) { |
|
|
|
if (array_key_exists('content', $item)) { |
|
|
|
$id = $this->options['id'] . '-collapse' . $index; |
|
|
|
$id = $this->options['id'] . '-collapse' . $index; |
|
|
|
$options = ArrayHelper::getValue($item, 'contentOptions', []); |
|
|
|
$options = ArrayHelper::getValue($item, 'contentOptions', []); |
|
|
|
$options['id'] = $id; |
|
|
|
$options['id'] = $id; |
|
|
|