コード例 #1
0
ファイル: HTMLForm.php プロジェクト: uhtoff/eCRF
 public function addInput($type, $name, $value = NULL, $label = NULL, $class = NULL, $language = NULL)
 {
     // Adds input to form
     $input = new HTMLInput($type, $name, $value, $language);
     if ($label) {
         $input->addLabel($label);
     }
     if ($class) {
         $input->addClass($class);
     }
     $this->inputs[] = $input;
     return $input;
 }
コード例 #2
0
ファイル: index.php プロジェクト: evandrolacerda/HTMLTags
$divNome = new HTMLDIV('d_nome');
$form->setMethod('POST');
$form->setAction($_SERVER['SCRIPT_NAME']);
$label = new HTMLLabel('Nome', 'i_nome');
$inputNome = new HTMLInput('text', 'i_nome');
$inputNome->addAttribute('value', "Evandro Pereira de Lacerda");
$inputNome->addAttribute('size', 60);
$text = new HTMLTextNode('Nome');
$label->addChild($inputNome);
$divNome->addChild($label);
//***************************************************
$divNascimento = new HTMLDIV('d_nasc');
$labelNascimento = new HTMLLabel("Data de Nascimento", 'i_nasc');
$nascimento = new HTMLInput('date', 'i_nasc');
$nascimento->addAttribute('size', 25);
$nascimento->addClass('input_n');
$nascimento->addClass('input_md');
$labelNascimento->addChild($nascimento);
$divNascimento->addChild($labelNascimento);
//***************************************************
$arrayOptions = ['Corsa', 'Fiesta', 'Cobalt', 'Onix', 'Escort', 'Ipanema', 'Uno', 'Palio', 'Gol', 'Verona'];
$select = new HTMLSelect('carros');
foreach ($arrayOptions as $opt) {
    if ($opt === 'Fiesta') {
        $select->addChild(new HTMLOption($opt, $opt, true));
    } else {
        $select->addChild(new HTMLOption($opt, $opt));
    }
}
$divTextArea = new HTMLDIV('text_area');
$textarea = new HTMLTextArea('message', 30, 5);