最近、フォームとサブフォームを扱っています。
私は以下を作成しました:
$form = new Application_Form_Cv();
$experience = new Zend_Form_SubForm();
$form->addSubForm($experience, 'experience');
'experience'
おかげで配列に要素があります
$form->addSubForm($experience, 'experience');.
私が次のことを試してみると:
$experience->addSubForm(new Application_Form_Experience(), '0');
$experience->addSubForm(new Application_Form_Experience(), '1');
オブジェクトはそれ自体を上書きし、「experience」要素を1つだけ取得し、0と1は存在しません。
array (
'controller' => 'cv',
'action' => 'index',
'module' => 'default',
'CvName' => 'Cv Ingenieur informatique',
'LanguageCode' => 'fr',
'UserID' => '2',
'experience' =>
array (
'CompanyName' => 'Mondial Assistance Ltd',
'From' => '2002',
'Until' => '2009',
'Current' => '1',
),
'submit' => 'Save CV',
)
Zend_Form_Subforms
配列に新しいキーを作成するだけですか?