public function __construct(Template_Lib $templat = null) { $templat && ($this->template = $templat); // process query_string FIRST as mapped routes may need it $this->process_query_string(); // on landing, set organisation and save visit info if (!isset($_SESSION['org_id'])) { $ses = new Session_Model($this->template, $this->query_string); $ses->save_session_info(); $ses->get_organisation(); } $this->load_routes(); //$this->process_uri(); $this->format = $this->get_format(); // set template's referer_url if one is available isset($_SERVER['HTTP_REFERER']) && $this->template && ($this->template->referer_url = $_SERVER['HTTP_REFERER']); // set current domain / host (ie from the url that someone typed in) isset($_SERVER['SERVER_NAME']) && $this->template && ($this->template->host = $_SERVER['SERVER_NAME']); /* $debug = new Debug_lib(); $debug->print_hash($_SERVER); echo "<p>PHP INPUT<br />"; print_r (file_get_contents('php://input')); echo "<p>POST info<br />"; $debug->print_hash($_POST); echo "<p>Check boxes ?<br />"; //echo $_POST['check']; $debug->print_hash($_POST['check']); echo "<p>Print from $ variables ?<br />"; echo "check: " . $check; */ }