Example #1
0
<?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>
Example #2
0
$labelNome->setTitulo("Nome: ");
$inputNome->setField("input")->setTypes("text")->setName("nome")->setValue("Seu nome");
$inputEmail = $form1->createField('input');
$labelEmail = $form1->createField('label');
$labelEmail->setTitulo("Nome: ");
$inputEmail->setField("input")->setTypes("text")->setName("nome")->setValue("Seu nome");
$labelMsg = $form1->createField('label');
$labelMsg->setTitulo("Digite aqui sua mensagem: ");
$textarea = $form1->createField('textarea');
$textarea->setCols("30")->setRows("4")->setValue("Digite aqui sua mensagem");
$button = $form1->createField('button');
$button->setType("submit")->setValue("Send");
$form1->addElement($fieldset)->addElement($labelNome)->addElement($inputNome)->addElement($labelEmail)->addElement($inputEmail)->addElement($labelMsg)->addElement($textarea)->addElement($button);
$form2 = clone $form1;
$form2->setMethod("GET")->setLegend("Este é o segundo formulário de teste")->setClass("teste");
$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">