How to create a nested lists in Yii2? Not a menu lists. I followed Yii2 docs.
So, in params.php in config directory I have an array.
The code is like this:
<?php
return [
'version' => 'framework: ' . Yii::getVersion() . ' version: ' . '0.0.0',
'description' => [
'app' => [
'PT. ABC' => [
'feature' => [
'Request IT-06',
'PEB'
],
'bug' => [
'No Bug'
],
'changelog' => [
'Initialize Program'
]
],
'PT. XYZ' => [
'feature' => [
'Request IT-06',
'PEB'
],
'bug' => [
'No Bug'
],
'changelog' => [
'Initialize Program'
]
],
],
],
];
I want to make a nested lists. I just know to display the index of array like this:
-PT. ABC
-PT. XYZ
This is my code:
<div class="col-lg-8">
<div class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">Welcome to <?= Yii::$app->params['version'] ?></h3>
</div>
<div class="panel-body">
<?= Html::ul(Yii::$app->params['description']['app'], [
'item' => function ($item, $index) {
return Html::tag(
'li',
$index,
['class' => 'post']
);
}
]) ?>
</div>
</div>
</div>
I need Like this,for example,
-PT. ABC
* feature
- feature 1
* bug
* changelog
-PT. XYZ
* feature
* bug
* changelog