Form builder label_class

edited February 2016 in Feature Requests
I've extended the Form builder class to add extra Bootstrap features, but here's an idea that is framework neutral: how about a 'label_class' param for adding a class to labels? I wanted to be able to add Bootstrap's "sr-only" to that tag.

In my extended class, create_label() has this added:
$class = ''; if (isset($params['label_class']) AND !empty($params['label_class'])) $class = 'class="'.$params['label_class'].'"'; .... $str .= "<label ".$class." for=\"".Form::create_id($id_name)."\" id=\"label_".Form::create_id($id_name)."\"".$styles.">";

Comments

Sign In or Register to comment.