2019-08-14 19:22:54 +02:00
|
|
|
<?php
|
|
|
|
namespace Post;
|
|
|
|
|
|
|
|
class FormField {
|
|
|
|
protected $value="";
|
|
|
|
|
|
|
|
public function __construct($vars = array()) {
|
|
|
|
foreach($vars as $k=>$v) {
|
|
|
|
$this->$k = $vars[$k];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getValue() {
|
|
|
|
return $this->value;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function setValue($val) {
|
|
|
|
$this->value=$val;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function reset() {
|
|
|
|
$this->value="";
|
|
|
|
}
|
|
|
|
|
|
|
|
public function loadFromEnv($name) {
|
2024-06-17 22:31:07 +02:00
|
|
|
$this->value=isset($_POST[$name])?$_POST[$name]:null;
|
2019-08-14 19:22:54 +02:00
|
|
|
}
|
|
|
|
}
|