ultimatepp/tutorial/Skylark11/main.cpp
cxl f18d29f38f .tutorial
git-svn-id: svn://ultimatepp.org/upp/trunk@5189 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2012-07-14 18:14:16 +00:00

38 lines
662 B
C++

#include <Skylark/Skylark.h>
#include <plugin/sqlite3/Sqlite3.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http("VAR", t_("Aborted by user."))
.RenderResult("Skylark11/index");
}
SKYLARK(SetLanguage, "setlanguage/*")
{
int lang = LNGFromText(http[0]);
if(lang)
http.SetLanguage(lang);
http.Redirect(HomePage);
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
threads = 1; // Sqlite3 does not like threads...
#ifdef _DEBUG
prefork = 0;
use_caching = false;
#endif
}
};
CONSOLE_APP_MAIN
{
#ifdef _DEBUG
StdLogSetup(LOG_FILE|LOG_COUT);
Ini::skylark_log = true;
#endif
MyApp().Run();
}