Source for file Form.php
Documentation is available at Form.php
- 1: <?php
- 3: /**
- 4: * Nette Framework
- 5: *
- 11: */
- 15: /**
- 16: * Creates, validates and renders HTML forms.
- 17: *
- 20: *
- 22: * @example forms/manual-rendering.php Manual form rendering and separated form and rules definition
- 27: * @example forms/CSRF-protection.php How to use Cross-Site Request Forgery (CSRF) form protection
- 29: *
- 40: */
- 42: {
- 43: /**#@+ operation name */
- 49: // button
- 52: // text
- 64: // file upload
- 68: // special case
- 70: /**#@-*/
- 72: /**#@+ method */
- 75: /**#@-*/
- 83: /** @var array of function(Form $sender); Occurs when the form is submitted and successfully validated */
- 86: /** @var array of function(Form $sender); Occurs when the form is submitted and not validated */
- 115: /**
- 116: * Form constructor.
- 118: */
- 120: {
- 131: }
- 133: }
- 137: /**
- 138: * This method will be called when the component (or component's parent)
- 139: * becomes attached to a monitored object. Do not call this method yourself.
- 142: */
- 144: {
- 147: }
- 148: }
- 152: /**
- 153: * Returns self.
- 155: */
- 157: {
- 159: }
- 163: /**
- 164: * Sets form's action.
- 167: */
- 169: {
- 172: }
- 176: /**
- 177: * Returns form's action.
- 179: */
- 181: {
- 183: }
- 187: /**
- 188: * Sets form's method.
- 191: */
- 193: {
- 196: }
- 199: }
- 203: /**
- 204: * Returns form's method.
- 206: */
- 208: {
- 210: }
- 214: /**
- 216: */
- 218: {
- 219: throw new DeprecatedException(__METHOD__ . '() is deprecated; pass form name to the constructor.');
- 220: }
- 224: /**
- 225: * Cross-Site Request Forgery (CSRF) form protection.
- 229: */
- 231: {
- 238: }
- 241: $this[self::PROTECTOR_ID]->addRule(':equal', empty($message) ? 'Security token did not match. Possible CSRF attack.' : $message, $token);
- 242: }
- 246: /**
- 247: * Adds fieldset group to the form.
- 251: */
- 253: {
- 260: }
- 266: }
- 267: }
- 271: /**
- 272: * Removes fieldset group from form.
- 275: */
- 277: {
- 287: }
- 291: }
- 294: }
- 298: /**
- 299: * Returns all defined groups.
- 301: */
- 303: {
- 305: }
- 309: /**
- 310: * Returns the specified group.
- 313: */
- 315: {
- 317: }
- 321: /**
- 322: * Set the encoding for the values.
- 325: */
- 327: {
- 330: throw new Exception("The PHP extension 'mbstring' is required for this encoding but is not loaded.");
- 331: }
- 333: }
- 337: /**
- 338: * Returns the encoding.
- 340: */
- 342: {
- 344: }
- 348: /********************* translator ****************d*g**/
- 352: /**
- 353: * Sets translate adapter.
- 356: */
- 358: {
- 361: }
- 365: /**
- 366: * Returns translate adapter.
- 368: */
- 370: {
- 372: }
- 376: /********************* submission ****************d*g**/
- 380: /**
- 381: * Tells if the form is anchored.
- 383: */
- 385: {
- 387: }
- 391: /**
- 392: * Tells if the form was submitted.
- 394: */
- 396: {
- 400: }
- 402: }
- 406: /**
- 407: * Sets the submittor control.
- 410: */
- 412: {
- 415: }
- 419: /**
- 420: * Returns submitted HTTP data.
- 422: */
- 424: {
- 427: throw new InvalidStateException('Form is not anchored and therefore can not determine whether it was submitted.');
- 428: }
- 430: }
- 432: }
- 436: /**
- 437: * Fires submit/click events.
- 439: */
- 441: {
- 452: }
- 459: }
- 460: }
- 464: /**
- 465: * Internal: receives submitted HTTP data.
- 467: */
- 469: {
- 473: }
- 480: }
- 485: }
- 486: }
- 489: }
- 493: /**
- 495: */
- 497: {
- 500: }
- 504: /********************* data exchange ****************d*g**/
- 508: /**
- 509: * Returns the values submitted by the form.
- 511: */
- 513: {
- 517: }
- 521: /********************* validation ****************d*g**/
- 525: /**
- 526: * Adds error message to the list.
- 529: */
- 531: {
- 535: }
- 536: }
- 540: /**
- 541: * Returns validation errors.
- 543: */
- 545: {
- 547: }
- 551: /**
- 553: */
- 555: {
- 557: }
- 561: /**
- 563: */
- 565: {
- 568: }
- 572: /********************* rendering ****************d*g**/
- 576: /**
- 577: * Returns form's HTML element template.
- 579: */
- 581: {
- 583: }
- 587: /**
- 588: * Sets form renderer.
- 591: */
- 593: {
- 596: }
- 600: /**
- 601: * Returns form renderer.
- 603: */
- 605: {
- 608: }
- 610: }
- 614: /**
- 615: * Renders form.
- 617: */
- 619: {
- 628: }
- 629: }
- 633: /**
- 634: * Renders form to string.
- 637: */
- 639: {
- 645: }
- 652: }
- 653: }
- 654: }
- 658: /********************* backend ****************d*g**/
- 662: /**
- 664: */
- 666: {
- 668: }
- 672: /**
- 674: */
- 676: {
- 678: }
- 680: }