I'm running Symfony 3.4 and FOSUserBundle (master version). I added 2 new fields in my custom User entity :
- firstname
- lastname
.. and I'm now trying to edit the profile edit form with those 2 new fields. I followed this tutorial : Overriding Default FOSUserBundle Forms, this is my custom Form :
<?php
namespace MyCompany\PimCoreBundle\Form\Type;
use FOS\UserBundle\Util\LegacyFormHelper;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Security\Core\Validator\Constraints\UserPassword;
use Symfony\Component\Validator\Constraints\NotBlank;
class ProfileFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
parent::buildForm($builder, $options);
$builder->add('firstname', 'text', array('label' => 'Firstname'));
$builder->add('lastname', 'text', array('label' => 'Lastname'));
}
public function getParent()
{
return 'FOS\UserBundle\Form\Type\ProfileFormType';
}
public function getBlockPrefix()
{
return 'app_user_profile';
}
}
?>
my config :
fos_user:
db_driver: orm # other valid values are 'mongodb' and 'couchdb'
firewall_name: main
user_class: MyCompany\PimCoreBundle\Entity\User
from_email:
address: "[email protected]"
sender_name: "MyCompany"
profile:
form:
type: MyCompany\PimCoreBundle\Form\Type\ProfileFormType
.. and my services :
services:
app.profile.form.type:
class: MyCompany\PimCoreBundle\Form\Type\ProfileFormType
tags:
- { name: form.type, alias: app_user_profile }
I made the changes in the config + services ymal files. But I get this error :
Could not load type "app_user_profile": class does not exist.
Can't understand what's wrong and how tu debug it !