Example: How to use naming containers
- 1: <?php
- 3: /**
- 4: * Nette\Forms naming containers example.
- 5: *
- 6: * - using naming containers
- 7: */
- 36: // Step 1: Define form with validation rules
- 39: // group First person
- 48: // group Second person
- 57: // group for buttons
- 64: // Step 2: Check if form was submitted?
- 67: // Step 2c: Check if form is valid
- 74: // this is the end, my friend :-)
- 76: }
- 79: }
- 83: // Step 3: Render form
- 84: ?>
- 85: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- 86: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- 87: <head>
- 88: <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- 89: <meta http-equiv="content-language" content="en" />
- 91: <title>Nette\Forms naming containers example | Nette Framework</title>
- 93: <style type="text/css">
- 94: <!--
- 95: .required {
- 96: color: darkred
- 97: }
- 99: fieldset {
- 100: padding: .5em;
- 101: margin: .3em 0;
- 102: background: #EAF3FA;
- 103: border: 1px solid #b2d1eb;
- 104: }
- 106: input.button {
- 107: font-size: 120%;
- 108: }
- 110: th {
- 111: width: 8em;
- 112: text-align: right;
- 113: }
- 114: -->
- 115: </style>
- 116: </head>
- 118: <body>
- 119: <h1>Nette\Forms naming containers example</h1>
- 122: </body>
- 123: </html>