function form_group_custom($pp = array()) { if (is_string($pp)) { if ($pp == 'close') { return '</div></div>'; } elseif ($pp == 'open') { $pp = array('label' => '', 'type' => 'open'); } else { $pp = array('label' => $pp, 'type' => 'open'); } } $cc = array('type' => 'open', 'label' => '', 'label_width' => 2, 'control_width' => 10); _extend_attributes($pp, $cc); if ($cc['type'] == 'open') { return '<div class="form-group"> <label class="control-label col-sm-' . $cc['label_width'] . '">' . $cc['label'] . '</label> <div class="col-sm-' . $cc['control_width'] . '">'; } else { return '</div></div>'; } }
function form_group_custom($attribute = array()) { if (is_string($attribute)) { if ($attribute == 'close') { return '</div></div>'; } elseif ($attribute == 'open') { $attribute = array('label' => '', 'type' => 'open'); } else { $attribute = array('label' => $attribute, 'type' => 'open'); } } $default = array('type' => 'open', 'label' => '', 'label_width' => 2, 'control_width' => 10); _extend_attributes($attribute, $default); if ($default['type'] == 'open') { return '<div class="form-group"> <label class="control-label col-xs-' . $default['label_width'] . '">' . $default['label'] . '</label> <div class="col-xs-' . $default['control_width'] . '">'; } else { return '</div></div>'; } }