diff --git a/crud/default/views/_expand.php b/crud/default/views/_expand.php
index 749256f..3c272be 100644
--- a/crud/default/views/_expand.php
+++ b/crud/default/views/_expand.php
@@ -20,28 +20,33 @@
'content' => $this->render('_detail', [
'model' => $model,
]),
- ],
+ ]
+];
$rel): ?>
skippedRelations)): ?>
- [
- 'label' => ' '. Html::encode(= $generator->generateString(Inflector::camel2words($rel[1])) ?>),
- 'options' => ['id' => "tab_= $rel[1] ?>_{$model->= $pk ?>}"],
- 'content' => $this->render('_data= $rel[1] ?>', [
- 'model' => $model,
- 'row' => $model->= $name ?>,
- ]),
- ],
+ if (!empty($model->= $name ?>)) {
+ $items[] =
+ [
+ 'label' => ' '. Html::encode(= $generator->generateString(Inflector::camel2words($rel[1])) ?>),
+ 'options' => ['id' => "tab_= $rel[1] ?>_{$model->= $pk ?>}"],
+ 'content' => $this->render('_data= $rel[1] ?>', [
+ 'model' => $model,
+ 'row' => $model->= $name ?>,
+ ]),
+ ];
+ }
- [
- 'label' => ' '. Html::encode(= $generator->generateString(Inflector::camel2words($rel[1])) ?>),
- 'options' => ['id' => "tab_= $rel[1] ?>_{$model->= $pk ?>}"],
- 'content' => $this->render('_data= $rel[1] ?>', [
- 'model' => $model->= $name ?>
- ]),
- ],
+ $items[] =
+ [
+ 'label' => ' '. Html::encode(= $generator->generateString(Inflector::camel2words($rel[1])) ?>),
+ 'options' => ['id' => "tab_= $rel[1] ?>_{$model->= $pk ?>}"],
+ 'content' => $this->render('_data= $rel[1] ?>', [
+ 'model' => $model->= $name ?>
+ ]),
+ ];
-];
+
echo TabsX::widget([
'items' => $items,
'position' => TabsX::POS_ABOVE,