public function render($content) { $element = $this->getElement(); $class = $element->getAttrib('class'); if (strpos($class, 'display_hidden') === false) { return $content; } $label = new Zend_Form_Decorator_Label(array('tag' => 'td')); $label->setElement($element); $label = $label->render(''); $value = htmlentities($element->getValue()); return "<tr>{$label}<td class=\"element\">{$value}{$content}</td></tr>\n"; }
public function render($content) { if ($this->getElement() instanceof Zend_Form_Element_Checkbox) { $this->_placement = self::IMPLICIT_APPEND; $class = $this->getOption('class'); $this->setOption('class', $class ? $class . ' checkbox' : 'checkbox'); } return parent::render($content); }
public function render($content) { $label = $this->getElement()->getLabel(); if (!is_null($label) && trim($label) !== 0) { return parent::render($content); } else { return $content; } }
/** * Get class with which to define label * * Appends either 'optional' or 'required' to class, depending on whether * or not the element is required. * * @return string */ public function getClass() { $class = parent::getClass() . ' control-label'; $dimensionLabel = $this->getDimension(); if (!empty($dimensionLabel)) { foreach (explode(',', $dimensionLabel) as $size) { $class .= ' col-' . trim($size); } } return $class; }
public function getLabel() { $element = $this->getElement(); $errors = $element->getMessages(); if (empty($errors)) { return parent::getLabel(); } $label = trim($element->getLabel()); $label .= ' <strong>' . implode('</strong><br /><strong>', $errors) . '</strong>'; $element->setLabel($label); return parent::getLabel(); }
public function getLabel() { $element = $this->getElement(); $errors = $element->getMessages(); if (empty($errors)) { return parent::getLabel(); } $label = trim($element->getLabel()); $label .= ' <span class="errorlabel">*' . implode(' ', $errors) . '</span>'; $element->setLabel($label); return parent::getLabel(); }
public function render($content) { $class = (string) $this->getTagClass(); $element = $this->getElement(); // add element-type class $elementType = strtolower(get_class($element)); $last = strrpos($elementType, '_'); if ($last !== false) { $elementType = substr($elementType, $last + 1); } $class .= " element-type-" . $elementType; // add element-has-errors and element-required classes if ($element instanceof Zend_Form_Element) { if ($element->hasErrors()) { $class .= ' element-has-errors'; } if ($element->isRequired()) { $class .= ' element-required'; } } $this->setTagClass(trim($class)); return parent::render($content); }
/** * Construit le Label du champ * Ajoute la classe required si le champ est marque comme requis * @brief Construit le label * @author francoisespinet * @param Zend_Form_Element $oElement */ protected function buildLabel(Zend_Form_Element $oElement) { // On passe par l'instanciantion à la différence de buildInput // car le décorateur label chargé par défaut wrap un dt autour du label $oDecorator = new Zend_Form_Decorator_Label(); return $oDecorator->setElement($oElement)->render(''); }
public function buildLabel($content) { $dec = new Zend_Form_Decorator_Label(); $dec->setElement($this->getElement()); return $dec->render($content); }