[EXTENSION] Bootstrap - Tabbable widget

Hello, Yii people!

I am new to Yii Framework and this is my first post in the forum. There are so many useful information here, but I couldn’t find anything related to my problem: How can I separate form fields into tabs using Tabbable widget from Bootstrap Extension. Here is a simple example of what I want to do:




$this->widget('bootstrap.widgets.BootTabbable', array(

    'type'=>'tabs',

    'placement'=>'above',

    'tabs'=>array(

        array('label'=>'Name', 'content'=>$this->renderPartial('_form1',array('model'=>$model)),'active'=>true),

        array('label'=>'Address', 'content'=>$this->renderPartial('_form2', array('model'=>$model))),

        and so on...

    ),

));



…where the fields from _form1, _form2,… must make a single form and on submit the $_POST array must contain all the fields from all the forms.

I hope that my question is understandable and someone can help me :)

Thanks in advance,

G.Velchev

I did it.

Hi Galin,

can you share how you did it

Haven’t done this myself but I think you should put the form head above the widget and (probably) the form button below the widget. Not sure that this is a good idea from a user experience POV. It will be difficult to open a particular tab when it’s form elements are in error state.




<?php echo $form = widget('xxx');?>


$this->widget('bootstrap.widgets.BootTabbable', array(   

    'type'=>'tabs',    

    'placement'=>'above',   

    'tabs'=>array(        

    	array(

  	  	'label'=>'Name', 

  	  	'content'=>$this->renderPartial('_form1',array('model'=>$model)),'active'=>true),        

    	array(

  	  	'label'=>'Address', 

  	  	'content'=>$this->renderPartial('_form2', array('model'=>$model))),        

and so on...    ),));

?>


<?php widget('submitbutton....');?>



Matt

How frustrating … I’m trying to do the same , care to share your solution ?