Example: Localization (with Zend_Translate)
- 1: <?php
- 3: /**
- 4: * Nette\Forms example 3
- 5: *
- 6: * - localization (with Zend_Translate)
- 7: */
- 12: // set_include_path();
- 17: }
- 25: {
- 26: /**
- 27: * Translates the given string.
- 31: */
- 33: {
- 35: }
- 36: }
- 56: // Step 1: Define form with validation rules
- 58: // enable translator
- 63: // group Personal data
- 81: // group Shipping address
- 90: // subgroup
- 106: // group Your account
- 125: // group for buttons
- 132: // Step 2: Check if form was submitted?
- 135: // Step 2c: Check if form is valid
- 142: // this is the end, my friend :-)
- 144: }
- 147: // not submitted, define default values
- 155: }
- 159: // Step 3: Render form
- 160: ?>
- 161: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- 162: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- 163: <head>
- 164: <meta http-equiv="content-type" content="text/html; charset=utf-8" />
- 165: <meta http-equiv="content-language" content="en" />
- 167: <title>Nette\Forms example 3 | Nette Framework</title>
- 169: <style type="text/css">
- 170: <!--
- 171: .required {
- 172: color: darkred
- 173: }
- 175: fieldset {
- 176: padding: .5em;
- 177: margin: .3em 0;
- 178: background: #EAF3FA;
- 179: border: 1px solid #b2d1eb;
- 180: }
- 182: input.button {
- 183: font-size: 120%;
- 184: }
- 186: th {
- 187: width: 8em;
- 188: text-align: right;
- 189: }
- 190: -->
- 191: </style>
- 192: </head>
- 194: <body>
- 195: <h1>Nette\Forms example 3</h1>
- 198: </body>
- 199: </html>