-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
render
to respond with template engine (4d tags as default)
- Loading branch information
1 parent
3dc7c19
commit 21a2679
Showing
8 changed files
with
158 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Class extends Response | ||
|
||
Class constructor | ||
C_VARIANT:C1683($1)// file or text | ||
C_LONGINT:C283($2) | ||
C_OBJECT:C1216($3) | ||
C_OBJECT:C1216($4) | ||
/*C_OBJECT($5)*/ | ||
Super:C1705($1;$2;$3) | ||
This:C1470.data:=$4// data to process | ||
/*This.context:=$5 to choose template engine? */ | ||
|
||
If (Value type:C1509(This:C1470.response)=Is object:K8:27) | ||
If (OB Instance of:C1731(This:C1470.response.getText;4D:C1709.Function))// less restrictive thn file | ||
This:C1470.response:=This:C1470.response.getText() | ||
End if | ||
End if | ||
|
||
This:C1470.response:=cs:C1710.Template4DTag.new().render(This:C1470.response;This:C1470.data) | ||
|
||
Function doSend | ||
Super:C1706.doSend() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
Function render | ||
C_OBJECT:C1216($2) | ||
C_TEXT:C284($0;$1;$outputText) | ||
PROCESS 4D TAGS:C816($1;$outputText;$2) | ||
$0:=$outputText |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,94 @@ | ||
<html> | ||
|
||
<head> | ||
<style> | ||
body { | ||
margin: 0; | ||
height: 100vh; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
background: cornsilk; | ||
} | ||
|
||
ul { | ||
padding: 0; | ||
list-style-type: none; | ||
} | ||
|
||
ul li { | ||
box-sizing: border-box; | ||
width: 15em; | ||
height: 3em; | ||
font-size: 20px; | ||
border-radius: 0.5em; | ||
margin: 0.5em; | ||
box-shadow: 0 0 1em rgba(0, 0, 0, 0.2); | ||
color: white; | ||
font-family: sans-serif; | ||
text-transform: capitalize; | ||
line-height: 3em; | ||
transition: 0.3s; | ||
cursor: pointer; | ||
} | ||
|
||
ul li:nth-child(odd) { | ||
background: linear-gradient(to right, orange, tomato); | ||
text-align: left; | ||
padding-left: 10%; | ||
transform: perspective(500px) rotateY(45deg); | ||
} | ||
|
||
ul li:nth-child(even) { | ||
background: linear-gradient(to left, orange, tomato); | ||
text-align: right; | ||
padding-right: 10%; | ||
transform: perspective(500px) rotateY(-45deg); | ||
} | ||
|
||
ul li:nth-child(odd):hover { | ||
transform: perspective(200px) rotateY(45deg); | ||
padding-left: 5%; | ||
} | ||
|
||
ul li:nth-child(even):hover { | ||
transform: perspective(200px) rotateY(-45deg); | ||
padding-right: 5%; | ||
} | ||
|
||
.name { | ||
box-sizing: border-box; | ||
width: 15em; | ||
height: 8em; | ||
font-size: 20px; | ||
border-radius: 0.5em; | ||
margin: 0.5em; | ||
box-shadow: 0 0 1em rgba(0, 0, 0, 0.2); | ||
background: linear-gradient(to right, orange, tomato); | ||
color: white; | ||
font-family: sans-serif; | ||
text-transform: capitalize; | ||
line-height: 3em; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<div> | ||
<div class="name"> | ||
<b> | ||
<!--#4DEVAL $1.lastname --></b><br /> | ||
<!--#4DEVAL $1.firstname --> | ||
<br /> | ||
</div> | ||
<ul> | ||
<!--#4DEVAL $i:=0--> | ||
<!--#4DLOOP ($i<$1.menu.length)--> | ||
<li><!--#4DEVAL $1.menu[$i]--></li> | ||
<!--#4DEVAL $i:=$i+1--> | ||
<!--#4DENDLOOP--> | ||
</ul> | ||
</div> | ||
</body> | ||
|
||
</html> |