delphimvcframework/samples/eluaserversideviews/www/list.elua

22 lines
718 B
Plaintext

<?lua require 'userlib.commons'?>
<?lua dofile(__document_root__..'header.lua')?>
<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>