N
N
NubasLol2018-09-18 19:08:26
symfony
NubasLol, 2018-09-18 19:08:26

Symfony how to set the author by Id?

There is a news table associated with USER

* @ORM\ManyToOne(targetEntity="UsersBundle\Entity\User", inversedBy="User")

I need to make it possible in the form to insert the id of the desired author, and assign his news when editing .
I tried with symfony forms, nothing happened, I did a normal imput, but how then to display messages in case of an incorrectly set id?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim, 2018-09-18
@NubasLol

Use this type of field in the form - https://symfony.com/doc/current/reference/forms/ty...
It's all there in the doc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question