public function indexAction() { $factory = new FormularioFactory(); $request = new Request(); // FORM 1 $form = new Formulario($factory); // attr form $form->setAttr("action", "/populate"); // items form $form->createField(["type" => "text", "label" => "Nome", "placeholder" => "Nome", "name" => "nome", "class" => "form-control", "validate" => ["empty" => false]]); $form->createField(["type" => "text", "label" => "Valor", "placeholder" => "Valor", "name" => "valor", "class" => "form-control", "validate" => ["numeric" => true]]); $form->createField(["type" => "text", "label" => "Descrição", "placeholder" => "Descrição", "name" => "descricao", "class" => "form-control", "validate" => ["min" => 200]]); $form->createField(["type" => "select", "label" => "Categoria", "name" => "categoria", "options" => [1 => "Celular", 2 => "Informática", 3 => "Escritório", 4 => "Casa", 5 => "Moda"], "class" => "form-control"]); $form->createField(["type" => "submit", "value" => "Cadastrar", "class" => "btn btn-primary"]); $form->popular($this->arrProduto); // $form->setErrorType(4); $this->route->formulario = $form->render(); }