delphimvcframework/samples/eluaserversideviews/www/list.elua
daniele.teti dd2955a807
2014-04-01 18:06:43 +00:00

22 lines
702 B
Plaintext

<?lua require 'Lua.html.form'?>
<?lua require 'userlib.commons'?>
<html>
<body>
<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>
<ul>
<?lua for _, customer in ipairs(customers) do ?>
<li><?lua=customer.firstName .. " " .. customer.lastName ?></li>
<?lua end ?>
</ul>
<hr>
<a href="/newcustomer.elua">Add New Customer</a>
</body>
</html>