symfony - How to override register form FosUserBundle? -
i want override of fosuserbundle forms ( registration form ) followed documentation , cant understand why keep getting same error :
attempted load class "registrationformtype" namespace "oc\userbundle\form\type". did forget "use" statement "fos\userbundle\form\type\registrationformtype"? 500 internal server error - classnotfoundexception.
these files:
registrationformtype.php:
<?php namespace oc\userbundle\form\type; use symfony\component\form\formbuilder; use fos\userbundle\form\type\registrationformtype basetype; class registrationformtype extends basetype { public function buildform(formbuilder $builder, array $options) { parent::buildform($builder, $options); $builder->add('telephone'); } public function getname() { return 'oc_user_registration'; } }
service.yml of ocuserbundle:
services: oc_user_registration: class: oc\userbundle\form\type\registrationformtype tags: - {name: form.type, alias: oc_user_registration}
and configured project use form type when user tries register in app/ressources/config.yml:
fos_user: db_driver: orm firewall_name: main user_class: oc\userbundle\entity\user registration: form: type: oc_user_registration
please can tell me what's wrong here?
solved this. error path path formtype file wasn't same namespace. thank anyway.
Comments
Post a Comment