allow default value for field

This commit is contained in:
Nicolas Roman 2019-03-21 09:52:40 +01:00 committed by Ludovic Poujol
parent 6e8ea737de
commit fdce16652a
1 changed files with 2 additions and 1 deletions

View File

@ -187,8 +187,9 @@ class FormPage {
}
}
public function addField($name, $obj) {
public function addField($name, $obj, $default_value="") {
$obj->setName($name);
if ($default_value != "") $obj->setValue($default_value);
array_push($this->fields, array($name, $obj));
}