Hi everybody,
Let me start by saying that I'm a real fan of the new form framework.
I think it can really save the develop quite some time in the long run
but I do have some concerns. The first I would like to vent is about
radio buttons and checkboxes. Hopefully I understand the frameworks
approach and we can have a discussion about the current implementation
of checkbox and radio button widgets.
Checkboxes:
For implementing checkboxes you now have to create another form and
embed that. I really don't see why this approach was chosen over for
example an option like this:
$option = array('choices' => MyObjectPeer::getCheckBoxChoises())
Radio buttons:
For implementing radio button the data population of the widget is
intuitive but when I want to render the radio buttons in a table with
some other data of the related object I have to hack my way in quite
ugly.
E.g.
<?php
$radio_widget = $form['my_radio_button']->getWidget();
?>
<?php foreach ($radio_widget->getOption('choices') as $key =>
$value): ?>
<?php
$attributes = array(
'name' => 'my_radio_button',
'type' => 'radio',
'value' => sfWidget::escapeOnce($key),
'id' => $radio_widget->generateId('my_radio_button' . '[]',
sfWidget::escapeOnce($key))
); ?>
<tr>
<td><?php echo $radio_widget->renderTag('input', $attributes); ?></
td>
<td><?php echo $radio_widget->renderContentTag('label', $value,
array('for' => $attributes['id'])); ?></td>
<td><?php MyObjectPeer::retrieveByPK($key)->getMyColumnValue(); ?
></td>
</tr>
<?php endforeach; ?>
Why were these approach chosen over others and what are your opinions
on these widgets? Shouldn't they be useful on a standalone bases
without the need of adding an extra form? I understand I am a bit late
(ca 1.5 year) to pitch in on this discussion but I just would like to
understand the approaches before I start to code things to fit my own
needs.
Thanks in advance,
Marijn
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony developers" 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-devs?hl=en
-~----------~----~----~----~------~----~------~--~---