Permalink
Browse files

allow the label to pick up default properties from the inputDefaults.…

… merges in any options and they can be overridden locally
  • Loading branch information...
1 parent 43cf2f0 commit c6590840896b508d3bf7152fdda99bac4c92f2b9 @nabeelio committed Apr 5, 2012
Showing with 10 additions and 0 deletions.
  1. +10 −0 lib/Cake/View/Helper/FormHelper.php
@@ -795,6 +795,16 @@ public function label($fieldName = null, $text = null, $options = array()) {
$options = array('class' => $options);
}
+ if(!isset($options['class'])) {
+ if(isset($this->_inputDefaults['label'])) {
+ if(is_string($this->_inputDefaults['label'])) {
+ $options['class'] = $this->_inputDefaults['label'];
+ } else {
+ $options = array_merge($this->_inputDefaults['label'], $options);
+ }
+ }
+ }
+
if (isset($options['for'])) {
$labelFor = $options['for'];
unset($options['for']);

0 comments on commit c659084

Please sign in to comment.