From 9ed7a5cd5538dd8f659d0bf22feb05ff1fd98b7c Mon Sep 17 00:00:00 2001 From: mark_story Date: Sat, 31 Oct 2009 00:58:21 -0400 Subject: [PATCH] Adding new options into doc blocks. Removing todo as its implemented already. --- cake/libs/view/helpers/form.php | 6 ++++-- cake/tests/cases/libs/view/helpers/form.test.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cake/libs/view/helpers/form.php b/cake/libs/view/helpers/form.php index 38cc1914a..4137fd95b 100755 --- a/cake/libs/view/helpers/form.php +++ b/cake/libs/view/helpers/form.php @@ -889,11 +889,11 @@ class FormHelper extends AppHelper { * * - `value` - the value of the checkbox * - `checked` - boolean indicate that this checkbox is checked. + * - `hiddenField` - boolean to indicate if you want the results of radio() to include + * a hidden input with a value of ''. This is useful for creating radio sets that non-continuous * * @param string $fieldName Name of a field, like this "Modelname.fieldname" * @param array $options Array of HTML attributes. - * @todo Right now, automatically setting the 'checked' value is dependent on whether or not the - * checkbox is bound to a model. This should probably be re-evaluated in future versions. * @return string An HTML text input element */ function checkbox($fieldName, $options = array()) { @@ -934,6 +934,8 @@ class FormHelper extends AppHelper { * - `legend` - control whether or not the widget set has a fieldset & legend * - `value` - indicate a value that is should be checked * - `label` - boolean to indicate whether or not labels for widgets show be displayed + * - `hiddenField` - boolean to indicate if you want the results of radio() to include + * a hidden input with a value of ''. This is useful for creating radio sets that non-continuous * * @param string $fieldName Name of a field, like this "Modelname.fieldname" * @param array $options Radio button options array. diff --git a/cake/tests/cases/libs/view/helpers/form.test.php b/cake/tests/cases/libs/view/helpers/form.test.php index 0ffa77f39..b98e08ca5 100644 --- a/cake/tests/cases/libs/view/helpers/form.test.php +++ b/cake/tests/cases/libs/view/helpers/form.test.php @@ -3279,7 +3279,7 @@ class FormHelperTest extends CakeTestCase { $this->Form->validationErrors['Model']['field'] = 1; $this->Form->data['Contact']['published'] = 1; - $result = $this->Form->checkbox('Contact.published', array('id'=>'theID')); + $result = $this->Form->checkbox('Contact.published', array('id' => 'theID')); $expected = array( 'input' => array('type' => 'hidden', 'name' => 'data[Contact][published]', 'value' => '0', 'id' => 'theID_'), array('input' => array('type' => 'checkbox', 'name' => 'data[Contact][published]', 'value' => '1', 'id' => 'theID', 'checked' => 'checked'))