diff --git a/layouts/form/layout.bootstrap.latte b/layouts/form/layout.bootstrap.latte index a35590a..1cd15e2 100755 --- a/layouts/form/layout.bootstrap.latte +++ b/layouts/form/layout.bootstrap.latte @@ -27,7 +27,7 @@ {$field->getErrors()|implode} {/if} - {case "FuzeWorks\Forms\Fields\RadioField"} + {case "FuzeWorks\Forms\Fields\RadioField", "FuzeWorks\Forms\Fields\SelectField"} {$field|noescape} {default}
diff --git a/src/FuzeWorks/Forms/Fields/SelectField.php b/src/FuzeWorks/Forms/Fields/SelectField.php new file mode 100644 index 0000000..76a7624 --- /dev/null +++ b/src/FuzeWorks/Forms/Fields/SelectField.php @@ -0,0 +1,79 @@ +size = $size; + return $this; + } + + public function generateHtml(): string + { + $id = "id='".$this->getId()."'"; + $name = "name='".$this->getName()."'"; + $label = $this->getLabel(); + $lock = $this->lock ? "disabled" : ""; + $class = "class='".implode(" ", $this->classNames)."'"; + $required = !$this->optional ? "required" : ""; + $size = $this->size == 0 ? "" : "size='".$this->size."'"; + + $out = "
"; + $out .= ""; + $out .= "
"; + return $out; + } + +} \ No newline at end of file