ZfcUser と ZfcUserDoctrineORM で Zendframework 2 を使用しています。いくつかの追加情報を使用して、通常のユーザーを拡張しました。
今、私はregisterFormを適応させたいと思っています。そのため、ZfcUser\Form フォルダーにこのフォームを作成しました。
class UserRegister extends ZfcUser\Form\Register {
public function init(){
$this->add(array(
'name' => 'firstName',
'options' => array(
'label' => 'First Name',
),
'attributes' => array(
'type' => 'text'
),
));
$this->add(array(
'name' => 'name',
'options' => array(
'label' => 'Last Name',
),
'attributes' => array(
'type' => 'text'
),
));
}
}
次のステップでは、ZfcUser フォルダーの Module.php の getServiceConfig() 関数を変更しました。
'zfcuser_register_form' => function ($sm) {
$options = $sm->get('zfcuser_module_options');
$form = new Form\UserRegister(null, $options);
//$form->setCaptchaElement($sm->get('zfcuser_captcha_element'));
$form->setInputFilter(new Form\RegisterFilter(
new Validator\NoRecordExists(array(
'mapper' => $sm->get('zfcuser_user_mapper'),
'key' => 'email'
)),
new Validator\NoRecordExists(array(
'mapper' => $sm->get('zfcuser_user_mapper'),
'key' => 'username'
)),
$options
));
return $form;
},
登録 URL を呼び出すと、次のエラー メッセージが表示されます。
致命的なエラー: 24 行目の C:\xampp\htdocs\THWDiver\vendor\zf-commons\zfc-user\src\ZfcUser\Form\UserRegister.php のクラス UserRegister を再宣言できません
私は何を間違えていますか?