delphimvcframework/samples/eluaserversideviews/www/list.elua

21 lines
669 B
Plaintext
Raw Normal View History

2014-04-01 20:06:43 +02:00
<?lua require 'userlib.commons'?>
2014-04-01 19:07:43 +02:00
<html>
<body>
2014-04-01 20:06:43 +02:00
<h2>Customers List</h2>
<hr>
<h6>This is an html table automatically generated by the JSON prepared in the DMVC controller</h6>
<?lua= html_table(customers, {
{fieldname="firstName", coltitle = "First name"},
{fieldname="lastName", coltitle = "Last name"},
}) ?>
<hr>
<h6>This is a classic loop to generate html by hand</h6>
2014-04-01 19:07:43 +02:00
<ul>
2014-04-01 19:39:28 +02:00
<?lua for _, customer in ipairs(customers) do ?>
<li><?lua=customer.firstName .. " " .. customer.lastName ?></li>
2014-04-01 19:07:43 +02:00
<?lua end ?>
</ul>
2014-04-01 20:06:43 +02:00
<hr>
2014-04-01 19:07:43 +02:00
<a href="/newcustomer.elua">Add New Customer</a>
</body>
</html>