getting closer to full port of web app starter
This commit is contained in:
@@ -3,6 +3,12 @@
|
||||
RENDER(Request& context)
|
||||
{
|
||||
DTree t;
|
||||
DTree assoc_left;
|
||||
DTree assoc_right;
|
||||
DTree assoc_merged;
|
||||
DTree list_left;
|
||||
DTree list_right;
|
||||
DTree list_merged;
|
||||
|
||||
<>
|
||||
<link rel="stylesheet" href='style.css'></link>
|
||||
@@ -47,6 +53,40 @@ RENDER(Request& context)
|
||||
|
||||
?></pre>
|
||||
|
||||
Array Merge
|
||||
|
||||
<pre><?
|
||||
|
||||
assoc_left["name"] = "left";
|
||||
assoc_left["shared"] = "left-value";
|
||||
assoc_right["shared"] = "right-value";
|
||||
assoc_right["extra"] = "new-value";
|
||||
assoc_merged = array_merge(assoc_left, assoc_right);
|
||||
print("Associative merge:\n");
|
||||
print(var_dump(assoc_merged));
|
||||
|
||||
list_left.set_array();
|
||||
DTree a;
|
||||
a = "A";
|
||||
list_left.push(a);
|
||||
DTree b;
|
||||
b = "B";
|
||||
list_left.push(b);
|
||||
|
||||
list_right.set_array();
|
||||
DTree c;
|
||||
c = "C";
|
||||
list_right.push(c);
|
||||
DTree d;
|
||||
d = "D";
|
||||
list_right.push(d);
|
||||
|
||||
list_merged = array_merge(list_left, list_right);
|
||||
print("\nList merge:\n");
|
||||
print(var_dump(list_merged));
|
||||
|
||||
?></pre>
|
||||
|
||||
Params
|
||||
<pre><?= var_dump(context.params) ?></pre>
|
||||
</>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
|
||||
RENDER(Request& context)
|
||||
{
|
||||
DTree t;
|
||||
String sample = " Hello UCE World ";
|
||||
|
||||
<>
|
||||
<link rel="stylesheet" href='style.css'></link>
|
||||
@@ -16,7 +16,14 @@ RENDER(Request& context)
|
||||
|
||||
<pre style="white-space: pre-wrap"><?
|
||||
|
||||
print(String("!") + 60*60*24);
|
||||
print("sample: [", sample, "]\n");
|
||||
print("trim(sample): [", trim(sample), "]\n");
|
||||
print("substr(sample, 2, 5): [", substr(sample, 2, 5), "]\n");
|
||||
print("substr(sample, -7): [", substr(sample, -7), "]\n");
|
||||
print("strpos(sample, \"UCE\"): ", strpos(sample, "UCE"), "\n");
|
||||
print("contains(sample, \"World\"): ", contains(sample, "World") ? "true" : "false", "\n");
|
||||
print("str_starts_with(trim(sample), \"Hello\"): ", str_starts_with(trim(sample), "Hello") ? "true" : "false", "\n");
|
||||
print("str_ends_with(trim(sample), \"World\"): ", str_ends_with(trim(sample), "World") ? "true" : "false", "\n");
|
||||
|
||||
?></pre>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user