使用Symfony时出错

时间:2015-04-29 10:41:38

标签: php symfony doctrine

我想创建一个注册处理程序。我有一个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

0 个答案:

没有答案