Estoy intentando anular RegistrationFormType en Symfony2 FOSUserBundle. Estoy siguiendo la documentación y creo que he cubierto todo. Creé un paquete para contener mis modificaciones al FOSUserBundle y el siguiente código es de este paquete, así como la configuración de la aplicación.No se pudo cargar el error de tipo "XYZ" al reemplazar los tipos de formulario FOSUserBundle
Alguien ha experimentado esto al anular FOSUserBundle, o ver cualquier cosa en mi código que pueda ayudar a explicar por qué sigo recibiendo este error. Estoy en Symfony v2.0.4
RegistrationFormType.php
<?php
/*
* This file is part of the FOSUserBundle package.
*
* (c) FriendsOfSymfony <http://friendsofsymfony.github.com/>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Thrive\SaasBundle\Form\Type;
use Symfony\Component\Form\FormBuilder;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;
class RegistrationFormType extends BaseType
{
public function buildForm(FormBuilder $builder, array $options)
{
$builder
->add('firstname', null, array('error_bubbling' => true))
->add('lastname', null, array('error_bubbling' => true))
->add('company', null, array('error_bubbling' => true))
->add('email', 'email', array('error_bubbling' => true))
->add('username', null, array('error_bubbling' => true))
->add('plainPassword', 'repeated', array('type' => 'password', 'error_bubbling' => true))
;
}
public function getName()
{
return 'thrive_user_registration';
}
}
Services.yml
services:
thrive_saas_registration.form.type:
class: Thrive\SaasBundle\Form\Type\RegistrationFormType
arguments: [%fos_user.model.user.class%]
tags:
- { name: form.type, alias: thrive_user_registration}
configuración del archivo de aplicación
fos_user:
...
registration:
form:
type: thrive_user_registration
¿Qué le parece usar este parámetro '% fos_user.model.user.form_data_class%' en lugar de '% fos_user.model.user.class%' en la definición del servicio? –