Esempio n. 1
0
 /**
  * @inheritdoc
  */
 public function render($params = [])
 {
     if (!empty($params['tabbed'])) {
         $tabs = [];
         foreach ($this->items as $item) {
             if ($item instanceof Tab) {
                 $tabs[] = ['label' => $item->getLabel(), 'content' => $item->render($params)];
             }
         }
         $output = Html::beginTag('div', ['class' => 'nav-tabs-custom']);
         $output .= Tabs::widget(['items' => $tabs]);
         $output .= Html::endTag('div');
         return $output;
     } else {
         return parent::render($params);
     }
 }
Esempio n. 2
0
 /**
  * Create tab instance.
  *
  * @param string $name tab name
  * @param string $label tab label
  * @param array $items tab items
  * @param ActiveForm $form form instance
  * @param Model $model model instance
  */
 function __construct($name, $label, $items = [], $form = null, $model = null)
 {
     $this->label = $label;
     parent::__construct($name, $items, $form, $model);
 }