2017-03-15 16 views
0

yii2プロジェクトにウィザードを実装しようとしています。私は1つは私がマルチステップフォームsimilar to thisようにしたいフォームを作成する必要があり、私はそれだけでYii2ウィザードを実装できません

「コンテンツ」で動作します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); ?>

+0

私は今、コードを更新しましたが、どのように各ステップ内でいくつかのフィールドを検証するためにそれを実装することができています – Rachna

答えて

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() , 
関連する問題