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: {
- 129: }
- 131: }
- 135: /**
- 136: * This method will be called when the component (or component's parent)
- 137: * becomes attached to a monitored object. Do not call this method yourself.
- 140: */
- 142: {
- 145: }
- 146: }
- 150: /**
- 151: * Returns self.
- 153: */
- 155: {
- 157: }
- 161: /**
- 162: * Sets form's action.
- 165: */
- 167: {
- 170: }
- 174: /**
- 175: * Returns form's action.
- 177: */
- 179: {
- 181: }
- 185: /**
- 186: * Sets form's method.
- 189: */
- 191: {
- 194: }
- 197: }
- 201: /**
- 202: * Returns form's method.
- 204: */
- 206: {
- 208: }
- 212: /**
- 214: */
- 216: {
- 217: throw new DeprecatedException(__METHOD__ . '() is deprecated; pass form name to the constructor.');
- 218: }
- 222: /**
- 223: * Cross-Site Request Forgery (CSRF) form protection.
- 227: */
- 229: {
- 236: }
- 239: $this[self::PROTECTOR_ID]->addRule(':equal', empty($message) ? 'Security token did not match. Possible CSRF attack.' : $message, $token);
- 240: }
- 244: /**
- 245: * Adds fieldset group to the form.
- 249: */
- 251: {
- 258: }
- 264: }
- 265: }
- 269: /**
- 270: * Removes fieldset group from form.
- 273: */
- 275: {
- 285: }
- 289: }
- 292: }
- 296: /**
- 297: * Returns all defined groups.
- 299: */
- 301: {
- 303: }
- 307: /**
- 308: * Returns the specified group.
- 311: */
- 313: {
- 315: }
- 319: /**
- 320: * Set the encoding for the values.
- 323: */
- 325: {
- 328: throw new Exception("The PHP extension 'mbstring' is required for this encoding but is not loaded.");
- 329: }
- 331: }
- 335: /**
- 336: * Returns the encoding.
- 338: */
- 340: {
- 342: }
- 346: /********************* translator ****************d*g**/
- 350: /**
- 351: * Sets translate adapter.
- 354: */
- 356: {
- 359: }
- 363: /**
- 364: * Returns translate adapter.
- 366: */
- 368: {
- 370: }
- 374: /********************* submission ****************d*g**/
- 378: /**
- 379: * Tells if the form is anchored.
- 381: */
- 383: {
- 385: }
- 389: /**
- 390: * Tells if the form was submitted.
- 392: */
- 394: {
- 398: }
- 400: }
- 404: /**
- 405: * Sets the submittor control.
- 408: */
- 410: {
- 413: }
- 417: /**
- 418: * Returns submitted HTTP data.
- 420: */
- 422: {
- 425: throw new InvalidStateException('Form is not anchored and therefore can not determine whether it was submitted.');
- 426: }
- 428: }
- 430: }
- 434: /**
- 435: * Fires submit/click events.
- 437: */
- 439: {
- 450: }
- 457: }
- 458: }
- 462: /**
- 463: * Internal: receives submitted HTTP data.
- 465: */
- 467: {
- 471: }
- 478: }
- 483: }
- 484: }
- 487: }
- 491: /**
- 493: */
- 495: {
- 498: }
- 502: /********************* data exchange ****************d*g**/
- 506: /**
- 507: * Returns the values submitted by the form.
- 509: */
- 511: {
- 515: }
- 519: /********************* validation ****************d*g**/
- 523: /**
- 524: * Adds error message to the list.
- 527: */
- 529: {
- 533: }
- 534: }
- 538: /**
- 539: * Returns validation errors.
- 541: */
- 543: {
- 545: }
- 549: /**
- 551: */
- 553: {
- 555: }
- 559: /**
- 561: */
- 563: {
- 566: }
- 570: /********************* rendering ****************d*g**/
- 574: /**
- 575: * Returns form's HTML element template.
- 577: */
- 579: {
- 581: }
- 585: /**
- 586: * Sets form renderer.
- 589: */
- 591: {
- 594: }
- 598: /**
- 599: * Returns form renderer.
- 601: */
- 603: {
- 606: }
- 608: }
- 612: /**
- 613: * Renders form.
- 615: */
- 617: {
- 626: }
- 627: }
- 631: /**
- 632: * Renders form to string.
- 635: */
- 637: {
- 643: }
- 650: }
- 651: }
- 652: }
- 656: /********************* backend ****************d*g**/
- 660: /**
- 662: */
- 664: {
- 666: }
- 670: /**
- 672: */
- 674: {
- 676: }
- 678: }