Modify the forms system

This commit is contained in:
Antonio de la Rosa 2015-08-25 18:10:49 +02:00
parent faa1d76350
commit 1cc3c8cf34
5 changed files with 106 additions and 77 deletions

View file

@ -101,6 +101,12 @@ class PhangoField {
public $protected=false;
/**
* A property that set the default value
*/
public $default_value='';
/**
* Method used for internal tasks related with searchs. You can overwrite this method in your PhangoField object if you need translate the value that the user want search to a real value into the database.
*/
@ -158,6 +164,22 @@ class PhangoField {
}
/**
* Method for create a form, you only need subclass the field if you want another form different to default
*/
public function create_form()
{
$form=new BaseForm($this->name, $this->value);
$form->default_value=$this->default_value;
$form->required=$this->required;
$form->label=$this->label;
return $form;
}
}