public static function renderControl(\bootbuilder\Controls\Control $control, $return = false)
 {
     // Form group
     $html = "<div class='form-group";
     if ($control->isErrorState() && self::$displayerrors) {
         $html .= " has-error";
     }
     $html .= "'>";
     // Label
     if (!$control instanceof \bootbuilder\Controls\Checkbox && !$control instanceof \bootbuilder\Controls\Radio) {
         $html .= "<label for='{$control->getId()}' class='control-label " . self::$labelcol . "'>" . $control->getLabel() . "</label>";
     } else {
         $html .= "<label class='control-label " . self::$labelcol . "'></label>";
     }
     // Control
     $html .= "<div class='" . self::$controlcol . "'>";
     $html .= $control->renderBasic();
     // HelpText
     if ($control->getHelpText() !== null && strlen($control->getHelpText()) > 0) {
         $html .= "<span class='help-block'>" . $control->getHelpText() . "</span>";
     }
     $html .= "</div>";
     // Close control div
     $html .= "</div>";
     // Close form-group div
     return $html;
 }
示例#2
0
 /**
  * Render a form Control
  * @param \BootBuilder\Controls\Control $control the control to render
  * @param boolean $return Do you want to return the HTML?
  */
 public static function renderControl(\bootbuilder\Controls\Control $control, $return = false)
 {
     return $control->renderBasic();
 }
示例#3
0
 public function __construct($label, $id = null)
 {
     parent::__construct("", $label, $id, null);
     $this->controls = array();
 }