मैं Symfony2 FOSUserBundle में पंजीकरणफॉर्म टाइप को ओवरराइड करने का प्रयास कर रहा हूं। मैं प्रलेखन का पालन कर रहा हूं और मानता हूं कि मैंने सब कुछ शामिल किया है। मैंने अपने ओवरराइड को FOSUserBundle में रखने के लिए एक बंडल बनाया है और निम्न कोड इस बंडल के साथ-साथ एप्लिकेशन कॉन्फ़िगरेशन से है।FOSUserBundle फ़ॉर्म प्रकारों को ओवरराइड करते समय "XYZ" त्रुटि लोड नहीं कर सका
क्या किसी ने FOSUserBundle को ओवरराइड करते समय इसका अनुभव किया है, या मेरे कोड में कुछ भी देख रहा है जो यह समझाने में मदद करेगा कि मुझे यह त्रुटि क्यों मिल रही है। मैं सिम्फोनी 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}
आवेदन के कॉन्फ़िग फ़ाइल
fos_user:
...
registration:
form:
type: thrive_user_registration
सेवा पैरामीटर में '% fos_user.model.user.class%' के बजाय इस पैरामीटर '% fos_user.model.user.form_data_class%' का उपयोग करने के बारे में कैसे? –