public function openTag($attributesOrElement = null) { if (null === $attributesOrElement) { return '<label class="' . $this->cssClass . '">'; } return parent::openTag($attributesOrElement); }
/** * Generate an opening label tag * @param null|array|ElementInterface $attributesOrElement * @return string */ public function openTag($attributesOrElement = null) { $labelAttributes = array(); if (is_array($attributesOrElement)) { $labelAttributes = $attributesOrElement; } if ($attributesOrElement instanceof LabelOptionsAwareInterface) { $labelAttributes = $attributesOrElement->getLabelAttributes(); } $labelAttributes['class'] = 'control-label' . (empty($labelAttributes['class']) ? '' : ' ' . $labelAttributes['class']); return parent::openTag($labelAttributes); }