0
我想做而不被教條symfony的污物簡單的請求
$mail = new Subscription();
$request = $this->getRequest();
if ($request->getMethod() == "POST") {
$em = $this->getDoctrine()->getManager();
$samplees = $request->get("samplees");
$mail->setEmail($samplees);
$em->persist($mail);
$em->flush();
return $this->redirect($this->generateUrl('user_homepage'));
}
是的,謝謝這就是我所做的,它工作除了我認爲它會運行一個異常,當我寫兩次相同的郵件,因爲它是訂閱類 –
的主鍵,我放棄了嘗試趕上它,並工作 –