此代码仅显示第二个字段,我需要两个字段。感谢。
<?php echo Tabs::widget([
'items' => [
[
'label' => 'One',
'content' => $form->field($model, 'name'),
'content' => $form->field($model, 'type'),
'active' => true
],
........
答案 0 :(得分:1)
请参阅docs
echo Tabs::widget([
'items' => [
[
'label' => 'One',
'content' => 'Anim pariatur cliche...',
'active' => true
],
[
'label' => 'Two',
'content' => 'Anim pariatur cliche...',
'headerOptions' => [...],
'options' => ['id' => 'myveryownID'],
],
[
'label' => 'Example',
'url' => 'http://www.example.com',
],
[
'label' => 'Dropdown',
'items' => [
[
'label' => 'DropdownA',
'content' => 'DropdownA, Anim pariatur cliche...',
],
[
'label' => 'DropdownB',
'content' => 'DropdownB, Anim pariatur cliche...',
],
],
],
],
]);
答案 1 :(得分:0)
<?= Tabs::widget([
'items' => [
[
'label' => 'General',
'content' => $this->render('product_form1', ['model' => $model, 'form' => $form]),
'active' => true
],