public function __construct(Loader $loader, $opt = null) { $this->_container = Container::getInstance(); $this->_request = new Request($_REQUEST, $_SERVER); $this->_loader = $loader; if (!$opt) { $opt = []; } $loader->prepare($this, $opt); $this->_options = $opt; $this->_response = new Response(); //set default error handler $this->error(function () { echo "oops"; }, -1); if (isset($opt["url"])) { $this->request()->setUrl($opt["url"]); } self::$_inst = $this; }