public function __construct() { $this->app = App::getInstance(); $this->config = $this->app->getConfig(); $this->view = View::getInstance(); $this->input = InputData::getInstance(); }
function populateWithPost($obj) { $post = parent::getInstance()->postAll(); foreach ($post as $var => $value) { if (property_exists($obj, $var)) { if (is_array($value)) { $obj->{$var} = array_map('trim', $value); } else { //$setter = 'set'.$var; //$obj->$setter($value); $obj->{$var} = trim($value); } } else { throw new \Exception("Unexpected value for {$var} form input", 400); } } }
public function __call($name, $v) { return InputData::getInstance()->{$name}($v[0], $v[1], $v[2]); }