Agora para usá-los para chamar sua classe na sua página e efetuar as chamadas dentro do formulário, igual mostra abaixo:
<?php class HTML { //CONSTRUTOR public function __construct() { } //CONSTRUTOR //MÉTODOS $valor = $_REQUEST[$name]; $retorno = "<input type='text' name='$name' id='$name' maxlength='".$maxlength ."' value='".$valor."'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } $retorno = $retorno . " />"; print $retorno; } $valor = $_REQUEST[$name]; $retorno = "<input type='password' name='" . $name . "' id='$name' maxlength='".$maxlength ."' value='".$valor."'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } $retorno = $retorno . " />"; print $retorno; } $retorno = "<input type='radio' name='" . $name . "' value='".$valor."'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } //Deveria estar checkado? if(@$_REQUEST[$name] == $valor){ $retorno = $retorno . "checked"; } $retorno = $retorno . " />"; //Tem texto? if($texto){ $retorno = $retorno . $texto; } print $retorno; } $retorno = "<input type='checkbox' name='" . $name . "' value='".$valor."'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } //Deveria estar checkado? if($_REQUEST[$name] == $valor){ $retorno = $retorno . " checked"; } if($texto){ $texto = " <label for='$name'>$texto</label>"; } }else{ if($_REQUEST[$nome][$i] == $valor){ $retorno = $retorno . " checked='checked'"; break; } } } $retorno = $retorno . " />"; //Tem texto? if($texto){ $retorno = $retorno . $texto; } print $retorno; } $valor = $_REQUEST[$name]; $retorno = "<input type='hidden' name='" . $name . "' value='".$valor."'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } $retorno = $retorno . " />"; print $retorno; } $valor = $_REQUEST[$name]; $retorno = "<textarea name='" . $name . "' rows='" . $linhas . "' cols='" . $colunas . "' value='" . $valor . "'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } $retorno = $retorno . ">$valor</textarea>"; print $retorno; } $retorno = "<select name='".$name."' id='".$name."'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } $retorno .= ">"; foreach($arr as $key=>$value){ $retorno .= "<option value='".$value."'"; //Deveria estar checkado? if(@$_REQUEST[$name] == $value){ $retorno = $retorno . "selected"; } $retorno .= ">".$key."</option>"; } $retorno .="</select>"; print $retorno; } $html = ""; $selected = ""; { { foreach($arr as $key=>$value){ if($value == $valor){ $selected = "selected=\"selected\""; } } } else { $selected = "selected=\"selected\""; } } } } $html = "<option value=\"" . $valor . "\" " . $selected . " >" . $exibir . "</option>"; print $html; } $retorno = "<input type='submit' name='$name' id='$name' value='$texto'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } $retorno = $retorno . " />"; print $retorno; } $retorno = "<input type='image' src='$img' name='$name' id='$name'"; //Tem atributos? if($atributos){ $retorno = $retorno . " ". $atributos; } $retorno = $retorno . " />"; print $retorno; } //MÉTODOS } ?>
include_once 'HTML.php';
Até a próxima.