Answer the question
In order to leave comments, you need to log in
Creating a form in one place - processing in another. Is this correct in Symfony?
Roughly speaking - if I create a form and display it on the front, and behind
$propositionChat = $this->propositionChatService->createEntity();
$form = $this->createForm(PropositionChatType::class, $propositionChat);
//эту часть обработки вынесу в другую часть проекта в API и буду отправлять запросы с помощью AJAX.
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$this->propositionChatService->createMessage($propositionChat, $proposition, $this->getUser());
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question