Permalink
Browse files

Adding new options into doc blocks.

Removing todo as its implemented already.
  • Loading branch information...
1 parent ac302bb commit 9ed7a5cd5538dd8f659d0bf22feb05ff1fd98b7c @markstory markstory committed Oct 31, 2009
Showing with 5 additions and 3 deletions.
  1. +4 −2 cake/libs/view/helpers/form.php
  2. +1 −1 cake/tests/cases/libs/view/helpers/form.test.php
@@ -889,11 +889,11 @@ function input($fieldName, $options = array()) {
*
* - `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 @@ function checkbox($fieldName, $options = array()) {
* - `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.
@@ -3279,7 +3279,7 @@ function testCheckbox() {
$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'))

0 comments on commit 9ed7a5c

Please sign in to comment.