public function index()
 {
     $id = $_GET['id'];
     $content = sp_sql_page($id);
     $this->assign($content);
     $smeta = json_decode($content['smeta'], true);
     $tplname = isset($smeta['template']) ? $smeta['template'] : "";
     $tplname = sp_get_apphome_tpl($tplname, "page");
     $this->display(":{$tplname}");
 }
 public function index()
 {
     $id = $_GET['id'];
     $content = sp_sql_page($id);
     if (empty($content)) {
         header('HTTP/1.1 404 Not Found');
         header('Status:404 Not Found');
         if (sp_template_file_exists(MODULE_NAME . "/404")) {
             $this->display(":404");
         }
         return;
     }
     $this->assign($content);
     $smeta = json_decode($content['smeta'], true);
     $tplname = isset($smeta['template']) ? $smeta['template'] : "";
     $tplname = sp_get_apphome_tpl($tplname, "page");
     $this->display(":{$tplname}");
 }