Skip to content

Instantly share code, notes, and snippets.

@mehlah
Created May 5, 2013 21:27
Show Gist options
  • Save mehlah/5522243 to your computer and use it in GitHub Desktop.
Save mehlah/5522243 to your computer and use it in GitHub Desktop.
/**
* Generates a form field with a label, input, and error message (if applicable), all contained
* within a wrapping element.
*/
public function field($name, array $options = array()) {
if ($this->_binding && $this->_binding->errors($name)) {
$options['wrap']['class'] = 'error';
}
return parent::field($name, $options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment