if ($publish) { $success = true; } $render->render("admin.pages.save", ["system" => $config->system, "get" => $_GET, "success" => $success]); } }); //Components $route->respond("/components", function ($request, $response, $service, $app) { $app->isUser; $render = new render(); $config = new config(); $db = new db("components"); //Delete Component if (isset($request->delete)) { $component = new component(); $component->delete($request->delete); } $all = $db->convert($db->all()); $render->render("admin.components", ["system" => $config->system, "components" => $all]); }); //Components:Ajax Post $route->respond("POST", "/components/create", function ($request, $response, $service, $app) { $app->isUser; if (isset($_POST) && isset($request->title) && isset($request->filename) && !empty($request->title) && !empty($request->filename)) { $component = new component(); $component->create($_POST); $error = false; $text = ""; } else { $error = true; $text = "Unable to create component due to undefined value.";