2016-06-21 2 views
0

이 코드는 두 번째 필드 만 표시합니다. 두 필드가 모두 필요합니다. 감사.탭 위젯 Yii2를 사용하여 라벨에 여러 필드를 추가하는 방법은 무엇입니까?

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

를 참조하십시오 http://stackoverflow.com/questions/28276855/split-activeform-fields-into-different-tabs -with-tabs-widget –

답변

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