https://github.com/tayron/html-helper
Classes para geração de Html
https://github.com/tayron/html-helper
Last synced: 3 months ago
JSON representation
Classes para geração de Html
- Host: GitHub
- URL: https://github.com/tayron/html-helper
- Owner: tayron
- Created: 2015-05-12T16:12:43.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2015-05-17T22:27:33.000Z (about 10 years ago)
- Last Synced: 2025-01-20T23:34:15.895Z (4 months ago)
- Language: PHP
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Html-Helper
Classes PHP criadas como base de estudo para gerar elementos Html.Exemplo de utilização das classes
```
#!php
function __autoload($classe){
include_once 'Html/' . $classe.'.php';
}$nomeCompleto = new InputText(['id' => 'nome', 'name' => 'nome', 'type' => 'text', 'label' => 'Nome Completo:']);
$telefone = new InputText(['id' => 'telefone', 'name' => 'telefone', 'type' => 'text', 'label' => 'Telefone:']);
$email = new InputText(['id' => 'email', 'name' => 'email', 'type' => 'email', 'label' => 'Email:']);
$mensagem = new Textarea(['id' => 'mensagem', 'name' => 'menagem', 'label' => 'Mensagem:']);
$divNome = new Div($nomeCompleto, ['style' => 'display: block; padding: 5px']);
$divTelefone = new Div($telefone, ['style' => 'display: block; padding: 5px']);
$divEmail = new Div($email, ['style' => 'display: block; padding: 5px']);
$divMensagem = new Div($mensagem, ['style' => 'display: block; padding: 5px']);
$formulario = new Form(['method' => 'post']);
$formulario->addElement($divNome);
$formulario->addElement($divTelefone);
$formulario->addElement($divEmail);
$formulario->addElement($divMensagem);
echo $formulario->display('Enviar mensagem');
```
Resultado
```
Nome Completo:
Telefone:
Email:
Mensagem:
Enviar mensagem```