无法实现Yii2向导

时间:2017-03-15 11:25:28

标签: yii2-advanced-app wizard

我正试图在我的yii2项目中实现向导而没有运气。我有一个创建表单,我想以多步骤格式similar to this制作,我尝试this extension in yii2它仅适用于

'内容' => '这是第1步'

但我希望改用Activefields。有谁知道如何让它发挥作用?








<?php
$wizard_config = [
    'id' => 'stepwizard',
    'steps' => [
        1 => [
            'title' => 'Step 1',
            'icon' => 'glyphicon glyphicon-cloud-download',
            'content' => $form->field($model, 'door_no')->textInput() ,
            'skippable' => false,
            'buttons' => [
                'next' => [
                    'title' => 'Forward', 
                    'options' => [
                        'class' => 'disabled'
                    ],
                 ],
             ],
        ],
        2 => [
            'title' => 'Step 2',
            'icon' => 'glyphicon glyphicon-cloud-upload',
            'content' => '<h3>Step 2</h3>This is step 2',
            'skippable' => true,
        ],
        3 => [
            'title' => 'Step 3',
            'icon' => 'glyphicon glyphicon-transfer',
            'content' => '<h3>Step 3</h3>This is step 3',
        ],
    ],
    'complete_content' => "You are done!", // Optional final screen
    'start_step' => 1, // Optional, start with a specific step
];
?>

<?= \drsdre\wizardwidget\WizardWidget::widget($wizard_config); ?>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:0)

您需要通过控制器发送表单。

示例:

controller =
'content' => $this->renderPartial('xxx', ['model'=> $model , 'model2'=>
             $model2, 'model3'=>$model3 ,'xxxx'=> $xxxx,'xx'=> $xx, 'xxx'=>$xxx, ]),])

创建视图:

$this->render('_form3', [
        'content' => $content,
        'model3' => $model3,
        'model' => $model,
        'content' => $content
    ])
_form =  $form->field($model, 'door_no')->textInput() ,