我想创建一个注册处理程序。我有一个User
实体和Register.php。 Register.php扩展User
,注册设置哈希密码并返回结果。
Code:
public function registerAction(Request $request)
{
$em = $this->getDoctrine()->getManager();
$form = $this->createTestForm(new User);
$form->handleRequest($request);
if ($form->isValid()) {
$service = new Register($form->getData());
$register = $service->register();
$em->persist($register);
$em->flush();
// return $this->redirectToRoute(...);
}
return $this->render('AcmeExampleBundle:User:test.html.twig', array(
'form' => $form->createView(),
));
}
我收到此错误:The class 'Acme\ExampleBundle\Libs\Register' was not found in the chain configured namespaces AcmeExample\Bundle\Entity