整个错误是由于标题最大字符而被替换为 3 个点的任务命名空间Symfony\Component\Form 。
因此,我正在按照文档中提供的步骤进行操作,但我无法找到我遇到的错误的来源。如果有人可以提供帮助,我将不胜感激。
这是我的AuthController中的方法
/**
* @Route("/register", name="registrationPage")
*/
public function showRegistrationPage(Request $request)
{
return $this->render('auth/register.html.twig', [
'register_form' => $this->createForm(RegisterType::class, (new UserInformation()))
]);
}
这是方法,我在其中声明表单
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('firstname', TextType::class, ['attr' => ['class' => 'form-control']])
->add('secondname', TextType::class, ['attr' => ['class' => 'form-control']])
->add('email', EmailType::class, ['attr' => ['class' => 'form-control']])
->add('password', PasswordType::class, ['attr' => ['class' => 'form-control']])
->add('password_confirmation', PasswordType::class, [
'label' => 'Confirm Password',
'attr' => ['class' => 'form-control'],
'mapped' =>false
])
->add('Register', SubmitType::class, ['attr' => ['class' => 'btn btn-primary']]);
}