Skip to content

Commit

Permalink
Adding documentation on 'attributes' key for FormHelper::error
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Apr 20, 2010
1 parent 23eea00 commit e1c4b96
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions cake/libs/view/helpers/form.php
Expand Up @@ -469,7 +469,8 @@ function isFieldError($field) {
* - `class` string The classname for the error message
*
* @param string $field A field name, like "Modelname.fieldname"
* @param mixed $text Error message or array of $options
* @param mixed $text Error message or array of $options. If array, `attributes` key
* will get used as html attributes for error container
* @param array $options Rendering options for <div /> wrapper tag
* @return string If there are errors this method returns an error message, otherwise null.
* @access public
Expand Down Expand Up @@ -499,7 +500,7 @@ function error($field, $text = null, $options = array()) {
$options = array_merge($options, $text['attributes']);
}
$text = isset($text[$error]) ? $text[$error] : null;
unset($options[$error]);
unset($options[$error]);
}

if ($text != null) {
Expand Down Expand Up @@ -1458,7 +1459,7 @@ function select($fieldName, $options = array(), $selected = null, $attributes =
}

if (!empty($tag) || isset($template)) {
if (!isset($secure) || $secure == true) {
if (!isset($secure) || $secure == true) {
$this->__secure();
}
$select[] = sprintf($tag, $attributes['name'], $this->_parseAttributes(
Expand Down
2 changes: 1 addition & 1 deletion cake/tests/cases/libs/view/helpers/form.test.php
Expand Up @@ -3307,7 +3307,7 @@ function testSelectMultipleCheckboxes() {
'first',
'/label',
'/div',

array('div' => array('class' => 'checkbox')),
array('input' => array(
'type' => 'checkbox', 'name' => 'data[Model][tags][]',
Expand Down

0 comments on commit e1c4b96

Please sign in to comment.