summaryrefslogtreecommitdiff
path: root/examples/basic/example.ecpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/basic/example.ecpp')
-rw-r--r--examples/basic/example.ecpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/examples/basic/example.ecpp b/examples/basic/example.ecpp
new file mode 100644
index 0000000..44978b5
--- /dev/null
+++ b/examples/basic/example.ecpp
@@ -0,0 +1,33 @@
+<%
+#include <string>
+#include <iostream>
+#include <sstream>
+
+int main(int argc, char *argv[])
+{
+ int i;
+ std::stringstream _buf;
+
+%>
+<html>
+ <body>
+ <p>Hello <%= argv[0] %>!</p>
+ <table>
+ <tbody>
+ <% for (i = 1; i < argc; i++) { %>
+ <tr bgcolor="<%= i % 2 == 0 ? "#FFCCCC" : "#CCCCFF" %>">
+ <td><%= i %></td>
+ <td><%= argv[i] %></td>
+ </tr>
+ <% } %>
+ </tbody>
+ </table>
+ </body>
+</html>
+<%
+
+ std::string _output = _buf.str();
+ std::cout << _output;
+ return 0;
+}
+%>