smartyInit(); $this->assign('uname',$_SESSION['mds_user']); } public function run($action){ $this->actionName = $action; $this->requestRoute(); } public function display($template = null, $cache_id = null, $compile_id = null, $parent = null){ if(strpos($template,'/')){ $this->fetch($template, $cache_id, $compile_id, $parent, true); }else{ // display template $this->fetch(strtolower($this->actionName).'/'.$template, $cache_id, $compile_id, $parent, true); } } private function smartyInit(){ $this->template_dir = ONU_ROOT . "application/module/view"; $this->config_dir = ONU_ROOT . "config"; $this->cache_dir = ONU_ROOT . "application/cache"; $this->compile_dir = ONU_ROOT . "application/compile"; $this->left_delimiter = "<{"; $this->right_delimiter = "}>"; $this->caching = false; $this->cache_lifetime = "3000"; } private function requestRoute(){ $m = isset($_GET["m"])?$_GET["m"]:"index"; if(method_exists($this,$m)){ $this->$m(); } else{ die("Module '{$m}' Not Exists!"); } } }