ZF-12348: Dynamicly add elements with belongsTo


Trying to dynamicly add elements to form

$form  = new Application_Form_Foo();

$form->addElement('text', 'foo', array(
    'belongsTo' => 'params',

$form->addElement('file', 'bar', array(
    'belongsTo' => 'params',

and render form in view script:

echo $this->form;

In HTML text element has correct name -

But file element has incorrect name - 


Patch and unit tests added.

Another patch added.

This issue is still in progress. More tests needed!

This issue needs a review from CR-Team, because I think all changes ends in a BC break.