$form = $this->createForm(FormType::class);
AbstractController
if ($request->isXmlHttpRequest()) {
$data = $request->getContent();
$formData = $data[$form->getName()];
$result = $serializer->deserialize($formData, SiteCreateDto::class, 'json');
var_dump($result); exit;
}
$this->get('doctrine.orm.customer_entity_manager');
попахивает services:
_defaults:
autowire: true
autoconfigure: true
bind:
\Doctrine\ORM\EntityManagerInterface $customerEntityManager: '@doctrine.orm.customer_entity_manager'
public function __construct(EntityManagerInterface $customerEntityManager)
/**
* @Route(path="/")
*/
public function indexAction(\Symfony\Bridge\Doctrine\RegistryInterface $registry)
{
$repository = $registry->getRepository(Post::class, 'default');
dump($repository->findAll());
return new Response();
}
Основное - нет контроля потока данных.