Skip to content

Multiple models in a single step

Coackroach edited this page Jan 19, 2020 · 2 revisions

To use a multiple model across steps you can pass the array of models to the model option.

use buttflattery\formwizard\FormWizard;
echo FormWizard::widget([
'formOptions' => [
    'id' => 'my_form_multi_model_single_step',
    'options'=>[
        'class'=>'form-inline'
    ],
],
'steps' => [
    [
        'model' => [$shootsModel,$shootTagModel],
        'title' => 'My Shoots',
        'description' => 'Add your shoots',
        'formInfoText' => 'Fill all fields',
    ],
    [
        'model' => $userModel,
        'title' => 'Shoot Tags',
        'description' => 'Add your shoot tags',
        'formInfoText' => 'Fill all fields',
    ],
],
]);
Clone this wiki locally