如何使用标签窗口小部件YII2将多个字段放入标签中



此代码仅显示第二个字段,我需要两个字段。谢谢。

<?php echo Tabs::widget([
'items' => [
    [
        'label' => 'One',
        'content' => $form->field($model, 'name'),
    'content' => $form->field($model, 'type'),
        'active' => true
    ],
    ........

参见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...',
                 ],
            ],
        ],
    ],
]);
<?= Tabs::widget([
    'items' => [
        [
            'label' => 'General',
            'content' => $this->render('product_form1', ['model' => $model, 'form' => $form]),
            'active' => true
        ],

最新更新