Exemplo n.º 1
0
 public function renderContent(Customweb_Form_IRenderer $renderer)
 {
     $result = $renderer->renderOptionPrefix($this, $this->getValue());
     $result .= '<input type="checkbox" name="' . $this->getControlName() . '" class="' . $this->getCssClass() . '" ';
     if ($this->isChecked()) {
         $result .= ' checked="checked" ';
     }
     $result .= ' value="' . $this->getValue() . '" id="' . $this->getControlId() . '" /> ';
     $result .= '<label for="' . $this->getControlId() . '">' . $this->getLabel() . '</label>';
     $result .= $renderer->renderOptionPostfix($this, $this->getValue());
     return $result;
 }
Exemplo n.º 2
0
 /**
  * (non-PHPdoc)
  * @see Customweb_Form_Control_Abstract::renderContent()
  */
 public function renderContent(Customweb_Form_IRenderer $renderer)
 {
     $result = '';
     foreach ($this->getOptions() as $key => $label) {
         $result .= $renderer->renderOptionPrefix($this, $key);
         $result .= '<input type="radio" name="' . $this->getControlName() . '" class="' . $this->getCssClass() . '" ';
         if ($this->getDefaultValue() == $key) {
             $result .= ' checked="checked" ';
         }
         $result .= ' value="' . $key . '" id="' . $this->getControlId() . '-' . $key . '" />';
         $result .= '<label for="' . $this->getControlId() . '-' . $key . '">' . $label . '</label>';
         $result .= $renderer->renderOptionPostfix($this, $key);
     }
     return $result;
 }