I'm creating a form view and I want to organize the form fields with tabs structure, using the official Tabs widget.
Is it possible init the Tabs widget with the id (or class) of the div elements that contains the active form fields?
I'm creating a form view and I want to organize the form fields with tabs structure, using the official Tabs widget.
Is it possible init the Tabs widget with the id (or class) of the div elements that contains the active form fields?
I have another solution:
When we call
$form->field($model, 'name')->textInput()
, it will return the model of classyii\widgets\ActiveField
, so just continue calling a method of this class as$form->field($model, 'name')->textInput()->render()
. It will return a string then you can use it for the tab's content. I have an example code in my application for translating multi languages as the following code:Maybe it's help.
One example of how you can manage it is doing like this:
Example code:
views/site/contact.php
views/site/contact_form1.php
views/site/contact_form2.php
Hope this helps!
Just add at the top of your contact.php global $form; and all works fine.