0
createEditForm()メソッドでフォームエラーを取得したいと考えています。 私はこの$ editForm-> getErrors()を試しています。それでもエラーが出るたびに0のエラーを返します。 これは私のコードです:簡単な管理フォームでフォームエラーを取得する方法
public function createEventEditForm($entity, array $entityProperties)
{
$editForm = parent::createEditForm($entity, $entityProperties);
if($entity instanceof Event){
//dump($editForm->getErrors()); die;
//dump($editForm->getErrors()->count()); die;
$event_id = $this->request->query->get('id');
if(!$editForm->getErrors()->count()){
$event = new Event();
$event->setStatus(Event::STATUS_INACTIVE);
$this->getDoctrine()->getManager()->flush();
}
}
return $editForm;
}
誰も私を助けることができますか? ありがとうございます
ありがとう:) @MayaShah – Shefali