-
Notifications
You must be signed in to change notification settings - Fork 0
/
language syntax.txt
147 lines (141 loc) · 6.54 KB
/
language syntax.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
page background head("no title") {
image("https://i.pinimg.com/736x/5c/2b/29/5c2b2971110912a5de3afc97f25e909b--black-and-white-wallpaper.jpg" ,50,50,
["style" =>" background-position: center;
background-repeat: no-repeat;
background-size: cover;
pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: -1;"])
@yield("content")
}
page p0 head ("Login Form Design") extends background{
@section("content")
text ("Login" ,30,#ffffff,["style"=>"position: relative; font-size:30px ; text-align: center; font-weight: bold; line-height: 2; padding-top: 200px; padding-left: 450px; padding-right: 450px;
background-image: linear-gradient(to bottom, rgba(140, 140, 140, 1) 0%, rgba(0, 0, 0, 1) 100%), linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 100%);
background-clip: content-box;"])
form(post,"c1",["style"=>"text-align: center; padding-left: 450px; padding-right: 450px;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0,0,0,1) 100%), linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);
background-clip: content-box;"]){
textField("user","","enter your name",["style"=>" opacity: 0.5;"])
list(true){}
textField("password","","enter your password",["style"=>" opacity: 0.5;"])
list(true){}
button("submit" ,"/compiler_tests/posts.php",["type"=>"submit"] )
list(true){}
text ("not yet a member? " ,11,#ffffff)
link('registerPage.php'){
text ("register" ,12,#ffffff)}
}
@endsection
}
page registerPage head ("registration"){
image("https://i.pinimg.com/736x/5c/2b/29/5c2b2971110912a5de3afc97f25e909b--black-and-white-wallpaper.jpg" ,50,50,
["style" =>" background-position: center;
background-repeat: no-repeat;
background-size: cover;
pointer-events: none; position: absolute; width: 100%; height: 100%; z-index: -1;"])
text("credentials are not correct try to register",12,#000000,["class"=>"alert alert-warning"])
text ("Register" ,30,#ffffff,["style"=>"position: relative; font-size:30px ; text-align: center; font-weight: bold; line-height: 2; padding-top: 200px; padding-left: 450px; padding-right: 450px;
background-image: linear-gradient(to bottom, rgba(140, 140, 140, 1) 0%, rgba(0, 0, 0, 1) 100%), linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 100%);
background-clip: content-box;"])
form(post,"c1",["style"=>"text-align: center; padding-left: 450px; padding-right: 450px;
background-image: linear-gradient(to bottom, rgba(0, 0, 0, 1) 0%, rgba(0,0,0,1) 100%), linear-gradient(to bottom, rgba(0,0,0,1) 0%, rgba(0,0,0,1) 100%);
background-clip: content-box;"]){
textField("user","","enter your name",["style"=>" opacity: 0.5;"])
list(true){}
textField("password","","enter your password",["style"=>" opacity: 0.5;"])
list(true){}
textField("Email","","enter your email",["style"=>" opacity: 0.5;"])
list(true){}
button("register" ,"/compiler_tests/posts.php",["class"=>"btn btn-success","type"=>"submit"] )
list(true){}
text ("already a member? " ,11,#ffffff)
link('p0.php'){
text ("login" ,12,#ffffff)}
}
}
page posts head("my posts"){
@rawphp
echo $_SESSION['user'];
@endrawphp
button("create a new one" ,"/compiler_tests/c1.php",["class"=>"btn btn-success","type"=>"submit","style"=>"margin-left: 120px; margin-top: 20px; margin-bottom: 50px;"])
table(){header:{ text ("ID" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]), text ("title" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]), text ("created_at" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]) } ,
body: { text ("1" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]), text ("hello my posts" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]),text ("2022-06-25 11:00:00" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]),
text ("2" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]),text ("good news" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"]),text ("2022-06-25 16:00:00" ,20,#050000,["style"=>"margin-left: 120px; margin-top: 20px;"])
}}
@auth
@rawphp
echo "i am logged in"
@endrawphp
@else
@rawphp
echo "i am not logged in"
@endrawphp
@endauth
@role(['admin'])
text("i am an admin",20,#ffffff,["class"=>"alert alert-success"])
@else
text("i am not an admin",20,#ffffff,["class"=>"alert alert-success"])
@endrole
}
page page0 head("trying") {
form(get,"c1"){
checkbox("Default checkbox",3,"flexCheckDefault")
date("start date","start",2018-07-22)
list(true){
link('www.google.com'){
text ("hello" ,30,#050000)}
image("https://cdn.pixabay.com/photo/2015/09/16/08/55/online-942408_960_720.jpg" ,50,50)
}
textField("myField","enter your name","theValue")
list(true){}
selection (true,"select your favorite"){
"book" , "algo" : "story" , "wimpy"
}
radio newRadio (){
"book1" , "algo1" : "story1" , "wimpy1" }
button("submit" ,"/compiler_tests/c1.php",["type"=>"submit"] )}
@x=3
@v=shared_data(a)
shared_data(a)=@v
@g="this is a string"
table(){header:{ text ("name" ,20,#050000), text ("pic" ,20,#050000) } ,
body: { text ("rama" ,20,#050000), image("https://cdn.pixabay.com/photo/2015/09/16/08/55/online-942408_960_720.jpg" ,50,50)
}}
}
page p1 head("title2") extends p0 {
@x=[1,2,3,4]
@auth
@x++
@else
--@x
@endauth
}
page p2 head("no head") extends p1 {
@role(['admin','user'])
@x=[1,2,3,4,5]
@endrole
}
page p3 head("no head") extends p2 {
text ("My First Heading" ,24,#0000, ["heading tag"=>'h1'])
@yield("test")
text ("My first paragraph." ,10,#0000, ['Paragraph'=> 'p'])
}
page p4 head("no head") extends p3 {
@section("test") text ("My test paragraph." ,10,#0000, ['Paragraph'=> 'p'])
@endsection
}
controller c1 controles p0{
@name=form_data(user)
@password=form_data(password)
@s=checkValid(@name,@password)
@x=checkAuthenticated()
if(@s){
redirect posts
}
else {
redirect registerPage
}
}
controller c2 controles p0{
}
controller c3 controles p0{
}