![]() |
|
Code snippets for symfony 1.x |
|
The boolean is set to The third argument.
<?php echo radiobutton_tag('status', 'value1', true) ?> <?php echo radiobutton_tag('status', 'value2', false) ?>
It write like this.
<?php echo radiobutton_tag("status", "value1", $sf_params->get("status") == 'value1'); ?> <?php echo radiobutton_tag("status", "value2", $sf_params->get("status") == 'value2'); ?>
Comments on this snippet
How about using the fillin feature? It does it all for you.
At that time, I did not notice it.
Francois, is there a particular reason why symfony doesn't have radiobutton_array and checkbox_array helpers in FormHelper.php? Is it just too hard to generalize or something? This type of task would be very easy to do with a helper like that.