我正在使用 twitter bootstrap 创建一个手风琴,其中每个行项目都包含另一个手风琴。下面的代码在手风琴内部创建了手风琴,但内部手风琴不会崩溃,我就是不知道为什么。
$daysToBeShown: array(2) { [2]=> string(6) "Wednesday" [6]=> string(7) "Sunday" }
$teamForDaysArray: array(2) { ["Wednesday"]=> array(2) { [0]=> string(18) "09:00-09:30 (1022)" [1]=> string(18) "09:30-10:00 (1023)" } ["Sunday"]=> array(1) { [0]=> string(18) "16:10-16:50 (2033)" } }
<div class="accordion" id="accordion1">
<?php
foreach($daysToBeShown as $key => $value)
{
?>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapse<?php echo $key;?>">
<?php echo $value;?>
</a>
</div>
<div id="collapse<?php echo $key;?>" class="accordion-body collapse">
<div class="accordion-inner">
<div class="accordion" id="accordion2">
<?php
foreach($teamForDaysArray[$value] as $keys => $valueInner)
{
?>
<div class="accordion-group">
<div class="accordion-heading">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse<?php echo $valueInner;?>">
<?php echo $valueInner;?>
</a>
</div>
<div id="collapse<?php echo $valueInner;?>" class="accordion-body collapse" style="height: 0px;">
<div class="accordion-inner">
...
</div>
</div>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>