ultimatepp/tutorial/Skylark07/main.cpp
cxl 6842160aa5 .Skylark tutorial
git-svn-id: svn://ultimatepp.org/upp/trunk@5141 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2012-07-06 16:16:23 +00:00

39 lines
547 B
C++

#include <Skylark/Skylark.h>
using namespace Upp;
SKYLARK(HomePage, "")
{
http.RenderResult("Skylark07/index");
}
SKYLARK(Submit, "submit:POST")
{
Value h = http["LIST"];
ValueArray va;
if(IsValueArray(h))
va = h;
va.Add(http["id"]);
http.SessionSet("LIST", va);
http.Redirect(HomePage);
}
struct MyApp : SkylarkApp {
MyApp() {
root = "myapp";
#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();
}