-
Notifications
You must be signed in to change notification settings - Fork 13
Group Step Fields using Heading
Coackroach edited this page Apr 24, 2019
·
1 revision
When we are using a step for combined inputs/models like we have user
and profile
models and we have assigned the user
and profile
inputs in a single step and we want the fields the be grouped with a different heading which acts as a divider, see the image below to have an idea.
You can do it by using the option named stepHeadings
under the specific step you want the headings it takes an array with the following keys
-
text
(string) the text to be displayed as the heading. -
before
(string) the field before which you want the heading to appear. -
icon
(string) the markup for the icon like<i class="fa-user"></i>
or the image tag with url you want to display, it defaults to<i class="formwizard-quill-ico"></i>
. If you dont wish to use an icon you can passfalse
.
See the code below for usage
echo FormWizard::widget([
'steps' => [
[
'model' => new Shoots(),
'title' => 'My Shoots',
'description' => 'Add your shoots',
'formInfoText' => 'Fill all fields',
'stepHeadings' => [
[
'text' => 'Heading with default icon',
'before' => 'image'
],
[
'text' => 'Heading with no icon',
'before' => 'created_at',
'icon' => false
],
[
'text' => 'Heading with Custom Icon',
'before' => 'active',
'icon' => '<i class="formwizard-checkmark-ico"></i>'
]
],
],
[
'model' => new ContactForm(),
'title' => 'Contact Information',
'description' => 'Add your contact details',
'formInfoText' => 'Fill All fields'
]
]
]);
You will see the headings like below image
- Get Running with Minimal Options
- Disable ActiveForm Validation
- Enable Ajax Validation
- Add Custom Buttons
- Widget Constants
- Customizing Form Fields
- Configuring File Uploads
- Custom Field Order
- Single Model Across Steps
- Multiple models in a single step
-
Tabular Steps-(New)
- Working With Widgets
- Limiting Rows
- Dependent Inputs Since v1.7.2
- Skip-able Step-(Since v1.5.0)
- Enable Preview Step-(New)
- Group Fields-(New)
- Enable Form Persistence-(New)
- Enable Edit Mode - (Since v1.6.4)