Source for file ConventionalRenderer.php
Documentation is available at ConventionalRenderer.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 6: * Copyright (c) 2004, 2009 David Grudl (http://davidgrudl.com)
- 7: *
- 8: * This source file is subject to the "Nette license" that is bundled
- 9: * with this package in the file license.txt.
- 10: *
- 11: * For more information please see https://nette.org
- 12: *
- 19: */
- 29: /**
- 30: * Converts a Form into the HTML output.
- 31: *
- 35: */
- 37: {
- 38: /**
- 39: * /--- form.container
- 40: *
- 41: * /--- if (form.errors) error.container
- 42: * .... error.item [.class]
- 43: * \---
- 44: *
- 45: * /--- hidden.container
- 46: * .... HIDDEN CONTROLS
- 47: * \---
- 48: *
- 49: * /--- group.container
- 50: * .... group.label
- 51: * .... group.description
- 52: *
- 53: * /--- controls.container
- 54: *
- 55: * /--- pair.container [.required .optional .odd]
- 56: *
- 57: * /--- label.container
- 58: * .... LABEL
- 59: * .... label.suffix
- 60: * \---
- 61: *
- 62: * /--- control.container [.odd]
- 63: * .... CONTROL [.required .text .password .file .submit .button]
- 64: * .... control.description
- 65: * .... if (control.errors) error.container
- 66: * \---
- 67: * \---
- 68: * \---
- 69: * \---
- 70: * \--
- 71: *
- 138: /**
- 139: * Provides complete form rendering.
- 143: */
- 145: {
- 149: }
- 154: }
- 157: }
- 160: }
- 163: }
- 165: }
- 169: /**
- 170: * Sets JavaScript handler.
- 173: */
- 175: {
- 177: }
- 181: /**
- 182: * Returns JavaScript handler.
- 184: */
- 186: {
- 189: }
- 191: }
- 195: /**
- 196: * Initializes form.
- 198: */
- 200: {
- 204: }
- 206: // TODO: only for back compatiblity - remove?
- 211: }
- 216: }
- 217: }
- 218: }
- 222: /**
- 223: * Renders form begin.
- 225: */
- 227: {
- 232: }
- 235: }
- 239: /**
- 240: * Renders form end.
- 242: */
- 244: {
- 249: }
- 250: }
- 253: }
- 260: }
- 263: }
- 267: /**
- 268: * Renders validation errors (per form or per control).
- 271: */
- 273: {
- 285: }
- 287: }
- 289: }
- 290: }
- 294: /**
- 295: * Renders form body.
- 297: */
- 299: {
- 320: }
- 322: }
- 331: }
- 333: }
- 341: }
- 342: }
- 349: }
- 353: /**
- 354: * Renders group of controls.
- 357: */
- 359: {
- 362: }
- 368: if ($control->getOption('rendered') || $control instanceof HiddenField || $control->getForm(FALSE) !== $this->form) {
- 369: // skip
- 378: }
- 380: }
- 381: }
- 385: }
- 390: }
- 393: }
- 397: /**
- 398: * Renders single visual row.
- 401: */
- 403: {
- 412: }
- 416: /**
- 417: * Renders single visual row of multiple controls.
- 420: */
- 422: {
- 427: }
- 429: }
- 434: }
- 438: /**
- 439: * Renders 'label' part of visual row of controls.
- 442: */
- 444: {
- 452: }
- 453: }
- 457: /**
- 458: * Renders 'control' part of visual row of controls.
- 461: */
- 463: {
- 476: }
- 480: }
- 483: return $body->setHtml((string) $control->getControl() . (string) $control->getLabel() . $description);
- 487: }
- 488: }
- 492: /**
- 495: */
- 497: {
- 500: }
- 504: /**
- 507: */
- 509: {
- 513: }
- 515: }
