33 lines
463 B
PHP
33 lines
463 B
PHP
|
<?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 validate() {
|
||
|
return true;
|
||
|
}
|
||
|
|
||
|
public function reset() {
|
||
|
$this->value="";
|
||
|
}
|
||
|
|
||
|
public function loadFromEnv($name) {
|
||
|
$this->value=$_POST[$name];
|
||
|
}
|
||
|
}
|