bugController.php
<?php
$form = new \Application\Form\ContactForm;
foreach ($form as $element) {
$labelAttributes = $element->getLabelAttributes();
if (isset($labelAttributes['class'])) {
if (false === strpos('control-label', $labelAttributes['class'])) {
$labelAttributes['class'] .= ' control-label';
}
}
else {
$labelAttributes['class'] = 'control-label';
}
$element->setLabelAttributes($labelAttributes);
}
if ($class = $form->getAttribute('class')) {
if (false === strpos('form-horizontal', $class)) {
$form->setAttribute('class', $class . ' form-horizontal');
}
}
else {
$form->setAttribute('class', 'form-horizontal');
}