0
이 새 모듈과에서 양식을 작성 제출하면 모든 필드 값을 표시되지하지만 난 양식을 제출할 때 하나의 필드는 다른 모든 못하고 그들의 값 값을 인쇄되어 있습니다ZF2 양식
을 10 개 이상의 필드가 있지만 전자 메일 필드 만 해당 값을 인쇄합니다. 다른 모든 필드는 비어 있습니다. 다음과 같이
public function __construct($name = null)
{
// we want to ignore the name passed
parent::__construct('company');
$this->add(array(
'name' => 'id',
'type' => 'Hidden',
));
$this->add(array(
'name' => 'email',
'type' => 'Text',
'options' => array(
//'label' => 'Strasse',
// 'placeholder' => 'Email'
),
'attributes' => array(
'placeholder' => 'Email',
),
));
$this->add(array(
'name' => 'firstname',
'type' => 'Text',
'options' => array(
//'label' => 'Strasse',
// 'placeholder' => 'Email'
),
'attributes' => array(
'placeholder' => 'Vorname',
),
));
$this->add(array(
'name' => 'submit',
'type' => 'Submit',
'attributes' => array(
'value' => 'Go',
'id' => 'submitbutton',
),
));
}
내가 내 모달의 값을 얻고 있지만 모든 값을 표시되지 :
이 내가 내 양식에있는 것입니다.
public function saveCompany(Company $company)
{
$data = array(
'firstname' => $company->firstname,
'email' => $company->email,
);
echo '<pre>'; print_r($data);
exit;
왜 내가 틀렸는가를 지적하고 여기에 더 많은 코드가 필요하면 알려 주시기 바랍니다.