Search code examples
zend-framework2zend-db-tablezfcuser

How to add custom fields in ZFC-user module for zend 2 without doctrine?


I have tried using creating a different module and attaching the ZfcUser\Form\Register over init method. But it wasn't working. I want to add few custom fields, with changing any thing in the vendor dir, as is it not a good practice. I also tried using user_entity_class ,creating a custom 'User' class, but it was creating some route issue in other modules, with zfc-user , I'm also using zfc-admin and zfc-adminuser, the error was coming in zfc-adminuser, Couldn't found the class was the error. Thanks in advance.


Solution

  • Well there are some issue regarding the overriding of the module ZFC-User, But still you can overwrite it manually. One way I have used is a bit old fashioned but working. What I have done is I have copied complete module the to module folder. Then pointing the form towards to my module where the changes are required, rest all are pointed to default.With this you can update your module. Make sure you point the user_entity_class to your module something like this:

    'user_entity_class' => 'MyZfcUser\Entity\User',

    you can find this in config\autoload\zfcuser.global.php