0

コントローラーでこのコードを試しました

$form = $this->createForm(new CentrexEdit2Type($ids), $centrex);

idsフォームビルダーにフォームを追加したい:

     public function buildForm(FormBuilderInterface $builder, array $options)
        {
          $ids = $options['ids']; 
          .......

私はそれに失敗しました

ここで私はコードに参加しています:

   if ($step==2){
        $form = $this->createForm(new CentrexEdit1Type(), $centrex);
        $ids=$form->get('bases')->getData();
        }

        foreach($ids as $id){echo($id->getId());}
        if ($step==3){
         $form = $this->createForm(new CentrexEdit2Type(array('ids'=>$ids)), $centrex);
        }

必要な$idsとき$step==3、これが問題です。

4

2 に答える 2