Allow preseeding form fields from URL parameters
This commit is contained in:
parent
8bacd9cfb0
commit
45ddd15ecf
8
Form.php
8
Form.php
@ -29,6 +29,14 @@ class Form {
|
||||
}
|
||||
}
|
||||
|
||||
public function preseedFromUrl() {
|
||||
foreach ($this->fields as $name=>$field) {
|
||||
if (isset($_GET[$name])) {
|
||||
$field->setValue($_GET[$name]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function loadFromEnv() {
|
||||
foreach ($this->fields as $name=>$field) {
|
||||
$field->loadFromEnv($name);
|
||||
|
Loading…
Reference in New Issue
Block a user