zend-frameworkmodulezend-autoloaderzfcuser

Extending/Replacing forms in ZfcUser by overloading the factories?


I am working with several team members in a project that will be using ZfcUser. I know that the documented way of extending the form is by attaching a listener to the form events inside the init method of our custom module.

This is fine and we can do it this way. However, we're trying to keep the Module classes with very little logic as there are a few junior developers that tend to get lost if we tell them that all form related logic will be placed in the Forms directory, except for the user stuff which is in the Module class.

So I am wondering if I over load the

'service_manager' => array( 'factories' => array( 'zfcuser_register_form' => function()

instance to load our own form, if this will freak out because sometimes the ZfcUser module gets loaded after our application modules?


Solution

  • If you put your module name below 'ZfcUser' inside /config/application.config.php then it will be guaranteed that your module is loaded after ZfcUser .