Example #1
0
 /**
  * Render a form <input> element from the provided $element
  *
  * @param  ElementInterface $element
  * @throws Exception\DomainException
  * @return string
  */
 public function render(ElementInterface $element)
 {
     $src = $element->getAttribute('src');
     if (empty($src)) {
         throw new Exception\DomainException(sprintf('%s requires that the element has an assigned src; none discovered', __METHOD__));
     }
     return parent::render($element);
 }
Example #2
0
 /**
  * Generate an opening label tag
  * @param  null|array|ElementInterface $attributesOrElement
  * @return string
  */
 public function openTag($attributesOrElement = null)
 {
     $labelAttributes = array();
     if ($attributesOrElement instanceof LabelOptionsAwareInterface) {
         $labelAttributes = $attributesOrElement->getLabelAttributes();
     }
     $labelAttributes['class'] = 'btn' . (empty($labelAttributes['class']) ? '' : ' ' . $labelAttributes['class']);
     return parent::openTag($labelAttributes);
 }