views:

298

answers:

4

Hi, Im trying to create a custom formatter in Symfony 1.4. I have embedded form via

$this->embedRelation('User','BasesfGuardUserAdminForm');

Is there a way to format the name of the embedded form 'User'?

A: 

IIRC BasesfGuardUserAdminForm AS User.

Crozin
Hi Crozin, u didn't get me...When the form renders, the view is:>>>> User <<<<Username:Password:Password Again:...I am talking about the marked 'User' which is the name of the embedded form. How can this be removed?
Prasad
Maybe what you want to achieve is merged form, not embed one?
Crozin
Correct, mergeform does solve that problem. But then there are a few other things that will be difficult to do. I was wondering if using the custom formatter the form name can be formatted (ignored)
Prasad
A: 

I has the same issue, and when I replaced embedForm() by mergedForm() the errors became easy to manipulate.

mere-teresa
But merge form brings along other issues - and difficulty in saving data automatically
Prasad
A: 
foreach ( $answers as $a )
{
    $aForm = new QuestionAnswerForm($a);
    $this->mergeForm($aForm);
}


    $this->widgetSchema->getFormFormatter()->setRowFormat('%field%%help%%hidden_fields%');
mere-teresa
A: 

I think this is most straight-forward! (and pretty obvious too!)

$this->embedForm('inner_form', new InnerForm());
$this->widgetSchema['inner_form']->setLabel('');

This will result in an empty label for the form!

Prasad
Prasad