<?php require_once __DIR__ . "/../autoload.php"; use Projeto\Types\Formulario\Form; use Projeto\Types\Elements\Input; $inputNome = new Input(); $inputNome->setName("nome")->setType("text")->setValue("Bruno"); $inputEmail = new Input(); $inputEmail->setName("email")->setType("email")->setValue("*****@*****.**"); $form = new Form(); $form->addElement($inputNome)->addElement($inputEmail); ?> <html> <head> <title>Formulário Dinâmico</title> </head> <body> <?php $form->render(); ?> </body> </html>
$form3 = new Form($validator); $form3->setMethod("POST")->setLegend("Formulário de teste(terceiro)")->setClass("teste"); $labelCombo = $form3->createField('label'); $labelCombo->setTitulo("Escolha o seu curso: "); $combobox = $form3->createField('select'); $combobox->setName("curso")->setOptions(array("" => "Selecione", "zf2" => "Zend 2", "sinfony" => "Sinfony", "laravel" => "Laravel")); $button = $form3->createField('button'); $button->setType("submit")->setValue("Send"); $form3->addElement($labelCombo)->addElement($combobox)->addElement($button); ?> <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>Formulário</title> <link rel="stylesheet" href="assets/css/styles.css"> </head> <body> <?php $form1->render(); echo "<br>"; $form2->render(); echo "<br>"; $form3->render(); ?> </body> </html>