Greetings,
I use symfony 1.2.5-DEV fron svn trunk. I have an admin form from
admin-generator.
I need dynamic inputs, and don't want to use embedded forms.
I build this for example:
$this->widgetSchema['group0'] = new sfWidgetFormSchema(array(
'name0' => new sfWidgetFormInput(),
'email0' => new sfWidgetFormInput(),
));
but generated code is:
<div>
<label for="t_object_key_group0">Group0</label>
<label for="t_object_key_group0_name0">Name0</label>
<input name="t_object_key[group0][name0]"
id="t_object_key_group0_name0" type="text">
<label for="t_object_key_group0_email0">Email0</label>
<input name="t_object_key[group0][email0]"
id="t_object_key_group0_email0" type="text">
</div>
screenshot:
http://lh6.ggpht.com/_67GcH7V6PNQ/ScIJ05P8pnI/AAAAAAAAFjo/cpeopqdAY4w/001.png
ok, then I FormFormatter
$decorator = new sfWidgetFormSchemaFormatterTable($this->widgetSchema
['group0']);
$this->widgetSchema['group0']->addFormFormatter('custom', $decorator);
$this->widgetSchema['group0']->setFormFormatterName('custom');
It took no effect.
Then I set RowFormat:
$this->widgetSchema['group0']->getFormFormatter()->setRowFormat
("\n<table> <th>%label%</th>\n <td>%error%%field%%help%
%hidden_fields
%</td>\n</tr></table>");
generated code is:
<div>
<label for="t_object_key_group0">Group0</label>
<table> <tbody><tr><th><label for="t_object_key_group0_name0">Name0</
label></th>
<td><input name="t_object_key[group0][name0]"
id="t_object_key_group0_name0" type="text"></td>
</tr></tbody></table>
<table> <tbody><tr><th><label
for="t_object_key_group0_email0">Email0</label></th>
<td><input name="t_object_key[group0][email0]"
id="t_object_key_group0_email0" type="text"></td>
</tr></tbody></table>
</div>
screenshot:
http://lh5.ggpht.com/_67GcH7V6PNQ/ScIJ10PrZrI/AAAAAAAAFjw/Mky9MT0VoZc/002.png
But it's not that I expected.
Then I try this:
$this->widgetSchema['group0'] = new sfWidgetFormSchema(array(
'grouped' => new sfWidgetFormSchema(array(
'name0' => new sfWidgetFormInput(),
'email0' => new sfWidgetFormInput(),
))
));
$this->widgetSchema['group0']->getFormFormatter()->setRowFormat
("\n<table> <th>%label%</th>\n <td>%error%%field%%help%
%hidden_fields
%</td>\n</tr></table>");
<div>
<label for="t_object_key_group0">Group0</label>
<table> <tbody><tr><th>Grouped</th>
<td></td></tr><tr>
<th><label for="t_object_key_group0_grouped_name0">Name0</label></
th>
<td><input name="t_object_key[group0][grouped][name0]"
id="t_object_key_group0_grouped_name0" type="text"></td>
</tr>
<tr>
<th><label for="t_object_key_group0_grouped_email0">Email0</label></
th>
<td><input name="t_object_key[group0][grouped][email0]"
id="t_object_key_group0_grouped_email0" type="text"></td>
</tr>
</tbody></table>
</div>
screenshot:
http://lh4.ggpht.com/_67GcH7V6PNQ/ScIJ2J4ZXSI/AAAAAAAAFj4/GGgFUzxcAdM/003.png
It seems to be that setFormFormatterName work only for embedded forms.
What I do wrong?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---