3

私はsymfony 3フォームを持っています。そして、次のように handleRequest を入力しようとしています:

$user = new User();
$userForm = $this->createForm(UserType::class, $user);
print_r($request->request->all());
$userForm->handleRequest($request);

print_r($userForm->getData());

私が得る出力は次のとおりです。

Array
(
    [firstName] => test
    [last_name] => test
    [email] => test@test.test
    [password] => erkeferke
    [gender] => F
    [supervisor] => 1
)
AppBundle\Entity\User Object
(
    [id:AppBundle\Entity\User:private] => 
    [firstName] => 
    [lastName:AppBundle\Entity\User:private] => 
    [email:AppBundle\Entity\User:private] => 
    [password:AppBundle\Entity\User:private] => 
    [photo:AppBundle\Entity\User:private] => 
    [gender:AppBundle\Entity\User:private] => 
    [supervisor:AppBundle\Entity\User:private] => 
    [duties:AppBundle\Entity\User:private] => 
    [lastLogin:AppBundle\Entity\User:private] => 
    [createdAt:AppBundle\Entity\User:private] => 
    [updatedAt:AppBundle\Entity\User:private] => 
    [deletedAt:AppBundle\Entity\User:private] => 
)

なぜ人口が増えていないのか、何か考えはありますか?

4

1 に答える 1