| 1 |
<!DOCTYPE html> |
| 2 |
<html> |
| 3 |
<head> |
| 4 |
<meta charset="utf-8"> |
| 5 |
<title>Nette Forms rendering using Latte</title> |
| 6 |
<link rel="stylesheet" media="screen" href="assets/style.css" /> |
| 7 |
<script src="https://nette.github.io/resources/js/3/netteForms.js"></script> |
| 8 |
</head> |
| 9 |
|
| 10 |
<body> |
| 11 |
<h1>Nette Forms rendering using Latte</h1> |
| 12 |
|
| 13 |
<form n:name=$form> |
| 14 |
<ul class=error n:ifcontent> |
| 15 |
<li n:foreach="$form->ownErrors as $error">{$error}</li> |
| 16 |
</ul> |
| 17 |
|
| 18 |
<table> |
| 19 |
<tr n:foreach="$form->controls as $input" |
| 20 |
n:if="!$input->getOption(rendered) && $input->getOption(type) !== hidden" |
| 21 |
n:class="$input->required ? required"> |
| 22 |
|
| 23 |
<th>{label $input /}</th> |
| 24 |
<td>{input $input} <span class=error n:ifcontent>{$input->error}</span></td> |
| 25 |
</tr> |
| 26 |
</table> |
| 27 |
</form> |
| 28 |
</body> |
| 29 |
</html> |
| 30 |
|