<?php
Class girisKontrol{
var $form=null;
function __construct(){
$this->form.='<form method="post" action="">';
}
function metinKontrol($name,$value,$tut){
$this->form.='<input type="text" name="'.$name.'" value="'.$value.'" placeholder="'.$tut.'">';
}
function sifreKontrol($name,$value,$tut){
$this->form.='<input type="password" name="'.$name.'" value="'.$value.'" placeholder="'.$tut.'">';
}
function metinKutusuKontrol($name,$value,$tut){
$this->form.='<textarea name="'.$name.'" placeholder="'.$tut.'">'.$value.'</textarea>';
}
function onayKutusuKontrol($name,$value){
$this->form.='<input type="checkbox" name="'.$name.'" value="'.$value.'">';
}
function radyoKontrol($name,$value){
$this->form.='<input type="radio" name="'.$name.'" value="'.$value.'">';
}
function butonKontrol($type,$name,$value,$tut){
$this->form.='<input type="'.$type.'" name="'.$name.'" value="'.$value.'" placeholder="'.$tut.'">';
}
function secenekEkle($name){
$this->form.='<option value="">'.$name.'</option>';
}
function listeKontrol($value){
$this->form.='<select name="">';
foreach($value as $v){
$this->form.=$this->secenekEkle($v);
}
$this->form.='</select>';
}
function yazdir(){
$this->form.='</form>';
return $this->form;
}
}
$gK = new girisKontrol;
$gK->metinKontrol("abc","","Bir metin giriniz");
$gK->sifreKontrol("abc","","Şifre");
$gK->metinKutusuKontrol("abc","","Birşeyler Yazınız");
$gK->listeKontrol(["Ankara","Aksaray"]);
$gK->onayKutusuKontrol("abcd","");
$gK->radyoKontrol("abc","");
$gK->butonKontrol("button","gonder","Tıkla","");
echo $gK->yazdir();
Çıktısı
<form method="post" action="">
<input type="text" name="abc" value="" placeholder="Bir metin giriniz"><input type="password" name="abc" value="" placeholder="Şifre">
<textarea name="abc" placeholder="Birşeyler Yazınız"></textarea>
<select name="">
<option value="">Ankara</option>
<option value="">Aksaray</option>
</select>
<input type="checkbox" name="abcd" value=""><input type="radio" name="abc" value=""><input type="button" name="gonder" value="Tıkla" placeholder="">
</form>