Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Allow the formHelper->label() to have default options from inputDefaults #596

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+10 −0
Split
@@ -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']);