Location: PHPKode > scripts > PHP Form elements > PHP Form elements/form.php
<?php
/**
* Author: Ovidiu S Bokar
* Licence: Free
* Version: 1.0 
* Copyright @ 2012
*/
class form
{
	public function form($action=null,$type=null,$attr=null){
		return '<form action="'.$action.'" method="'.$type.'" '.$attr.' >'; 
	}
	public function form_label($for=null,$name=null,$attr=null){
		return '<label for="'.$for.'" '.$attr.' >'.$name.'</label>';
	}
	public function form_input($type=null,$name=null, $attr=null){
		return '<input type="'.$type.'" name="'.$name.'" '.$attr.' />';
	}
	public function form_textarea($type=null,$name=null, $attr=null){
		return '<textarea type="'.$type.'" name="'.$name.'" '.$attr.'></textarea';
	}
	public function form_submit($name=null, $val=null ){
		return '<input type="submit" name="'.$name.'" value="'.$value.'" />';
	}
	public function form_button($type=null,$name=null, $attr=null ){
		return '<input type="'.$type.'" name="'.$name.'"  '.$attr.' />';
	}
	public function form_open_select($name=null,$attr=null){
		return '<select name="'.$name.'">';
	}
	public function form_option($val=null,$name=null,$attr=null){
		return '<option value="'.$val.'" '.$attr.' > '.$name.' </option>';
	}
	public function form_open_optgroup($for=null,$attr=null){
		return '<optgroup label="'.$for.'" '.$attr.' >';
	}
	public function form_close_optgroup(){
		return '</optgroup>';
	}
	public function form_close_select(){
		return '</select>';
	}
	public function form_close(){
		return '</form>';
	}
}
?>
Return current item: PHP Form elements