mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-30 23:02:39 -06:00
.Skylark tutorial
git-svn-id: svn://ultimatepp.org/upp/trunk@5139 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
711d716372
commit
a27fdcfc7e
11 changed files with 140 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
<html>
|
||||
<body>
|
||||
<a href=$Page2()>Link to page2</a><br>
|
||||
<a href=$Page2>Link to page2</a><br>
|
||||
$for(i in ["param_test", 123, "param_test3"])
|
||||
<a href=$Param(i)>Param test: $i</a><br>
|
||||
$endfor
|
||||
|
|
|
|||
14
tutorial/Skylark05/Skylark05.upp
Normal file
14
tutorial/Skylark05/Skylark05.upp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
description "FORM GET\377";
|
||||
|
||||
uses
|
||||
Core,
|
||||
Skylark;
|
||||
|
||||
file
|
||||
index.witz,
|
||||
submit.witz,
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "SSE2 MT";
|
||||
|
||||
10
tutorial/Skylark05/index.witz
Normal file
10
tutorial/Skylark05/index.witz
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<html>
|
||||
<body>
|
||||
<form action=$Submit method="get" accept-charset="utf-8" enctype="multipart/form-data">
|
||||
<P>
|
||||
<INPUT type="text" name="id">
|
||||
<INPUT type="submit" value="Submit">
|
||||
</P>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
5
tutorial/Skylark05/init
Normal file
5
tutorial/Skylark05/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _Skylark05_icpp_init_stub
|
||||
#define _Skylark05_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#include "Skylark/init"
|
||||
#endif
|
||||
34
tutorial/Skylark05/main.cpp
Normal file
34
tutorial/Skylark05/main.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <Skylark/Skylark.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
SKYLARK(HomePage, "")
|
||||
{
|
||||
http.RenderResult("Skylark05/index");
|
||||
}
|
||||
|
||||
SKYLARK(Submit, "submit")
|
||||
{
|
||||
http("RESULT", ToUpper((String)http["id"]))
|
||||
.RenderResult("Skylark05/submit");
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
6
tutorial/Skylark05/submit.witz
Normal file
6
tutorial/Skylark05/submit.witz
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<body>
|
||||
Result: $RESULT<br>
|
||||
<a href=$HomePage>Back to homepage</a>
|
||||
</body>
|
||||
</html>
|
||||
14
tutorial/Skylark06/Skylark06.upp
Normal file
14
tutorial/Skylark06/Skylark06.upp
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
description "FORM POST\377";
|
||||
|
||||
uses
|
||||
Core,
|
||||
Skylark;
|
||||
|
||||
file
|
||||
index.witz,
|
||||
submit.witz,
|
||||
main.cpp;
|
||||
|
||||
mainconfig
|
||||
"" = "SSE2 MT";
|
||||
|
||||
11
tutorial/Skylark06/index.witz
Normal file
11
tutorial/Skylark06/index.witz
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<html>
|
||||
<body>
|
||||
<form action=$Submit method="post" accept-charset="utf-8" enctype="multipart/form-data">
|
||||
<P>
|
||||
$post_identity()
|
||||
<INPUT type="text" name="id">
|
||||
<INPUT type="submit" value="Submit">
|
||||
</P>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
5
tutorial/Skylark06/init
Normal file
5
tutorial/Skylark06/init
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#ifndef _Skylark06_icpp_init_stub
|
||||
#define _Skylark06_icpp_init_stub
|
||||
#include "Core/init"
|
||||
#include "Skylark/init"
|
||||
#endif
|
||||
34
tutorial/Skylark06/main.cpp
Normal file
34
tutorial/Skylark06/main.cpp
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#include <Skylark/Skylark.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
SKYLARK(HomePage, "")
|
||||
{
|
||||
http.RenderResult("Skylark06/index");
|
||||
}
|
||||
|
||||
SKYLARK(Submit, "submit:POST")
|
||||
{
|
||||
http("RESULT", ToUpper((String)http["id"]))
|
||||
.RenderResult("Skylark06/submit");
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
6
tutorial/Skylark06/submit.witz
Normal file
6
tutorial/Skylark06/submit.witz
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<html>
|
||||
<body>
|
||||
Result: $RESULT<br>
|
||||
<a href=$HomePage>Back to homepage</a>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue