94e3a303c601e155aa845906e058a7015968e7d1
[GitHub/WoltLab/woltlab.github.io.git] / latest / php / api / form_builder / structure / index.html
1
2 <!doctype html>
3 <html lang="en" class="no-js">
4 <head>
5
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
8
9
10
11
12 <link rel="icon" href="../../../../assets/default.favicon.ico">
13 <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.0">
14
15
16
17 <title>Structure - WoltLab Suite Documentation</title>
18
19
20
21 <link rel="stylesheet" href="../../../../assets/stylesheets/main.33e2939f.min.css">
22
23
24 <link rel="stylesheet" href="../../../../assets/stylesheets/palette.ef6f36e2.min.css">
25
26
27
28 <meta name="theme-color" content="#009485">
29
30
31
32
33
34
35
36
37
38 <link rel="stylesheet" href="../../../../stylesheets/extra.css">
39
40
41
42
43
44 </head>
45
46
47
48
49
50
51
52 <body dir="ltr" data-md-color-scheme="" data-md-color-primary="teal" data-md-color-accent="">
53
54
55 <script>function __prefix(e){return new URL("../../../..",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
56
57 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
58 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
59 <label class="md-overlay" for="__drawer"></label>
60 <div data-md-component="skip">
61
62
63 <a href="#structure-of-form-builder" class="md-skip">
64 Skip to content
65 </a>
66
67 </div>
68 <div data-md-component="announce">
69
70 <aside class="md-announce">
71 <div class="md-announce__inner md-grid md-typeset">
72
73 <a href="https://www.woltlab.com">Back to <strong>woltlab.com</strong></a>
74
75 </div>
76 </aside>
77
78 </div>
79
80 <header class="md-header" data-md-component="header">
81 <nav class="md-header__inner md-grid" aria-label="Header">
82 <a href="../../../.." title="WoltLab Suite Documentation" class="md-header__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
83
84 <img src="../../../../assets/logo.png" alt="logo">
85
86 </a>
87 <label class="md-header__button md-icon" for="__drawer">
88 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
89 </label>
90 <div class="md-header__title" data-md-component="header-title">
91 <div class="md-header__ellipsis">
92 <div class="md-header__topic">
93 <span class="md-ellipsis">
94 WoltLab Suite Documentation
95 </span>
96 </div>
97 <div class="md-header__topic" data-md-component="header-topic">
98 <span class="md-ellipsis">
99
100 Structure
101
102 </span>
103 </div>
104 </div>
105 </div>
106
107
108
109 <label class="md-header__button md-icon" for="__search">
110 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
111 </label>
112
113 <div class="md-search" data-md-component="search" role="dialog">
114 <label class="md-search__overlay" for="__search"></label>
115 <div class="md-search__inner" role="search">
116 <form class="md-search__form" name="search">
117 <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
118 <label class="md-search__icon md-icon" for="__search">
119 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
120 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
121 </label>
122 <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
123 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
124 </button>
125 </form>
126 <div class="md-search__output">
127 <div class="md-search__scrollwrap" data-md-scrollfix>
128 <div class="md-search-result" data-md-component="search-result">
129 <div class="md-search-result__meta">
130 Initializing search
131 </div>
132 <ol class="md-search-result__list"></ol>
133 </div>
134 </div>
135 </div>
136 </div>
137 </div>
138
139
140 <div class="md-header__source">
141
142 <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
143 <div class="md-source__icon md-icon">
144
145 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
146 </div>
147 <div class="md-source__repository">
148 GitHub
149 </div>
150 </a>
151 </div>
152
153 </nav>
154 </header>
155
156 <div class="md-container" data-md-component="container">
157
158
159
160
161 <main class="md-main" data-md-component="main">
162 <div class="md-main__inner md-grid">
163
164
165
166 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
167 <div class="md-sidebar__scrollwrap">
168 <div class="md-sidebar__inner">
169
170
171
172 <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
173 <label class="md-nav__title" for="__drawer">
174 <a href="../../../.." title="WoltLab Suite Documentation" class="md-nav__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
175
176 <img src="../../../../assets/logo.png" alt="logo">
177
178 </a>
179 WoltLab Suite Documentation
180 </label>
181
182 <div class="md-nav__source">
183
184 <a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
185 <div class="md-source__icon md-icon">
186
187 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path d="M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
188 </div>
189 <div class="md-source__repository">
190 GitHub
191 </div>
192 </a>
193 </div>
194
195 <ul class="md-nav__list" data-md-scrollfix>
196
197
198
199
200
201
202
203
204 <li class="md-nav__item">
205 <a href="../../../../getting-started/" class="md-nav__link">
206 Getting Started
207 </a>
208 </li>
209
210
211
212
213
214
215
216
217
218
219
220
221
222 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
223
224
225 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" checked>
226
227 <label class="md-nav__link" for="__nav_2">
228 PHP API
229 <span class="md-nav__icon md-icon"></span>
230 </label>
231 <nav class="md-nav" aria-label="PHP API" data-md-level="1">
232 <label class="md-nav__title" for="__nav_2">
233 <span class="md-nav__icon md-icon"></span>
234 PHP API
235 </label>
236 <ul class="md-nav__list" data-md-scrollfix>
237
238
239
240
241
242 <li class="md-nav__item">
243 <a href="../../../pages/" class="md-nav__link">
244 Pages
245 </a>
246 </li>
247
248
249
250
251
252
253
254 <li class="md-nav__item">
255 <a href="../../../database-objects/" class="md-nav__link">
256 Database Objects
257 </a>
258 </li>
259
260
261
262
263
264
265
266 <li class="md-nav__item">
267 <a href="../../../database-access/" class="md-nav__link">
268 Database Access
269 </a>
270 </li>
271
272
273
274
275
276
277
278 <li class="md-nav__item">
279 <a href="../../../exceptions/" class="md-nav__link">
280 Exceptions
281 </a>
282 </li>
283
284
285
286
287
288
289
290
291
292
293 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
294
295
296 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5" type="checkbox" id="__nav_2_5" checked>
297
298 <label class="md-nav__link" for="__nav_2_5">
299 API
300 <span class="md-nav__icon md-icon"></span>
301 </label>
302 <nav class="md-nav" aria-label="API" data-md-level="2">
303 <label class="md-nav__title" for="__nav_2_5">
304 <span class="md-nav__icon md-icon"></span>
305 API
306 </label>
307 <ul class="md-nav__list" data-md-scrollfix>
308
309
310
311
312
313 <li class="md-nav__item">
314 <a href="../../caches/" class="md-nav__link">
315 Caches
316 </a>
317 </li>
318
319
320
321
322
323
324
325 <li class="md-nav__item">
326 <a href="../../comments/" class="md-nav__link">
327 Comments
328 </a>
329 </li>
330
331
332
333
334
335
336
337 <li class="md-nav__item">
338 <a href="../../cronjobs/" class="md-nav__link">
339 Cronjobs
340 </a>
341 </li>
342
343
344
345
346
347
348
349 <li class="md-nav__item">
350 <a href="../../events/" class="md-nav__link">
351 Events
352 </a>
353 </li>
354
355
356
357
358
359
360
361
362
363
364 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
365
366
367 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5_5" type="checkbox" id="__nav_2_5_5" checked>
368
369 <label class="md-nav__link" for="__nav_2_5_5">
370 Form Builder
371 <span class="md-nav__icon md-icon"></span>
372 </label>
373 <nav class="md-nav" aria-label="Form Builder" data-md-level="3">
374 <label class="md-nav__title" for="__nav_2_5_5">
375 <span class="md-nav__icon md-icon"></span>
376 Form Builder
377 </label>
378 <ul class="md-nav__list" data-md-scrollfix>
379
380
381
382
383
384 <li class="md-nav__item">
385 <a href="../overview/" class="md-nav__link">
386 Overview
387 </a>
388 </li>
389
390
391
392
393
394
395
396
397
398 <li class="md-nav__item md-nav__item--active">
399
400 <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
401
402
403
404
405 <label class="md-nav__link md-nav__link--active" for="__toc">
406 Structure
407 <span class="md-nav__icon md-icon"></span>
408 </label>
409
410 <a href="./" class="md-nav__link md-nav__link--active">
411 Structure
412 </a>
413
414
415 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
416
417
418
419
420
421 <label class="md-nav__title" for="__toc">
422 <span class="md-nav__icon md-icon"></span>
423 Table of contents
424 </label>
425 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
426
427 <li class="md-nav__item">
428 <a href="#form-nodes" class="md-nav__link">
429 Form Nodes
430 </a>
431
432 <nav class="md-nav" aria-label="Form Nodes">
433 <ul class="md-nav__list">
434
435 <li class="md-nav__item">
436 <a href="#iformnode" class="md-nav__link">
437 IFormNode
438 </a>
439
440 </li>
441
442 <li class="md-nav__item">
443 <a href="#iformchildnode" class="md-nav__link">
444 IFormChildNode
445 </a>
446
447 </li>
448
449 <li class="md-nav__item">
450 <a href="#iformparentnode" class="md-nav__link">
451 IFormParentNode
452 </a>
453
454 </li>
455
456 <li class="md-nav__item">
457 <a href="#iformelement" class="md-nav__link">
458 IFormElement
459 </a>
460
461 </li>
462
463 <li class="md-nav__item">
464 <a href="#iobjecttypeformnode" class="md-nav__link">
465 IObjectTypeFormNode
466 </a>
467
468 </li>
469
470 <li class="md-nav__item">
471 <a href="#customformnode" class="md-nav__link">
472 CustomFormNode
473 </a>
474
475 </li>
476
477 <li class="md-nav__item">
478 <a href="#templateformnode" class="md-nav__link">
479 TemplateFormNode
480 </a>
481
482 </li>
483
484 </ul>
485 </nav>
486
487 </li>
488
489 <li class="md-nav__item">
490 <a href="#form-document" class="md-nav__link">
491 Form Document
492 </a>
493
494 </li>
495
496 <li class="md-nav__item">
497 <a href="#form-button" class="md-nav__link">
498 Form Button
499 </a>
500
501 </li>
502
503 <li class="md-nav__item">
504 <a href="#form-container" class="md-nav__link">
505 Form Container
506 </a>
507
508 </li>
509
510 <li class="md-nav__item">
511 <a href="#form-field" class="md-nav__link">
512 Form Field
513 </a>
514
515 <nav class="md-nav" aria-label="Form Field">
516 <ul class="md-nav__list">
517
518 <li class="md-nav__item">
519 <a href="#form-field-interfaces-and-traits" class="md-nav__link">
520 Form Field Interfaces and Traits
521 </a>
522
523 <nav class="md-nav" aria-label="Form Field Interfaces and Traits">
524 <ul class="md-nav__list">
525
526 <li class="md-nav__item">
527 <a href="#iattributeformfield" class="md-nav__link">
528 IAttributeFormField
529 </a>
530
531 </li>
532
533 <li class="md-nav__item">
534 <a href="#iautocompleteformfield" class="md-nav__link">
535 IAutoCompleteFormField
536 </a>
537
538 </li>
539
540 <li class="md-nav__item">
541 <a href="#iautofocusformfield" class="md-nav__link">
542 IAutoFocusFormField
543 </a>
544
545 </li>
546
547 <li class="md-nav__item">
548 <a href="#icssclassformfield" class="md-nav__link">
549 ICssClassFormField
550 </a>
551
552 </li>
553
554 <li class="md-nav__item">
555 <a href="#ifileformfield" class="md-nav__link">
556 IFileFormField
557 </a>
558
559 </li>
560
561 <li class="md-nav__item">
562 <a href="#ifilterableselectionformfield" class="md-nav__link">
563 IFilterableSelectionFormField
564 </a>
565
566 </li>
567
568 <li class="md-nav__item">
569 <a href="#ii18nformfield" class="md-nav__link">
570 II18nFormField
571 </a>
572
573 </li>
574
575 <li class="md-nav__item">
576 <a href="#iimmutableformfield" class="md-nav__link">
577 IImmutableFormField
578 </a>
579
580 </li>
581
582 <li class="md-nav__item">
583 <a href="#iinputmodeformfield" class="md-nav__link">
584 IInputModeFormField
585 </a>
586
587 </li>
588
589 <li class="md-nav__item">
590 <a href="#imaximumformfield" class="md-nav__link">
591 IMaximumFormField
592 </a>
593
594 </li>
595
596 <li class="md-nav__item">
597 <a href="#imaximumlengthformfield" class="md-nav__link">
598 IMaximumLengthFormField
599 </a>
600
601 </li>
602
603 <li class="md-nav__item">
604 <a href="#iminimumformfield" class="md-nav__link">
605 IMinimumFormField
606 </a>
607
608 </li>
609
610 <li class="md-nav__item">
611 <a href="#iminimumlengthformfield" class="md-nav__link">
612 IMinimumLengthFormField
613 </a>
614
615 </li>
616
617 <li class="md-nav__item">
618 <a href="#imultipleformfield" class="md-nav__link">
619 IMultipleFormField
620 </a>
621
622 </li>
623
624 <li class="md-nav__item">
625 <a href="#inullableformfield" class="md-nav__link">
626 INullableFormField
627 </a>
628
629 </li>
630
631 <li class="md-nav__item">
632 <a href="#ipackagesformfield" class="md-nav__link">
633 IPackagesFormField
634 </a>
635
636 </li>
637
638 <li class="md-nav__item">
639 <a href="#ipatternformfield" class="md-nav__link">
640 IPatternFormField
641 </a>
642
643 </li>
644
645 <li class="md-nav__item">
646 <a href="#iplaceholderformfield" class="md-nav__link">
647 IPlaceholderFormField
648 </a>
649
650 </li>
651
652 <li class="md-nav__item">
653 <a href="#iselectionformfield" class="md-nav__link">
654 ISelectionFormField
655 </a>
656
657 </li>
658
659 <li class="md-nav__item">
660 <a href="#isuffixedformfield" class="md-nav__link">
661 ISuffixedFormField
662 </a>
663
664 </li>
665
666 <li class="md-nav__item">
667 <a href="#tdefaultidformfield" class="md-nav__link">
668 TDefaultIdFormField
669 </a>
670
671 </li>
672
673 </ul>
674 </nav>
675
676 </li>
677
678 </ul>
679 </nav>
680
681 </li>
682
683 <li class="md-nav__item">
684 <a href="#displaying-forms" class="md-nav__link">
685 Displaying Forms
686 </a>
687
688 </li>
689
690 </ul>
691
692 </nav>
693
694 </li>
695
696
697
698
699
700
701
702 <li class="md-nav__item">
703 <a href="../form_fields/" class="md-nav__link">
704 Fields
705 </a>
706 </li>
707
708
709
710
711
712
713
714 <li class="md-nav__item">
715 <a href="../validation_data/" class="md-nav__link">
716 Validation and Data
717 </a>
718 </li>
719
720
721
722
723
724
725
726 <li class="md-nav__item">
727 <a href="../dependencies/" class="md-nav__link">
728 Dependencies
729 </a>
730 </li>
731
732
733
734 </ul>
735 </nav>
736 </li>
737
738
739
740
741
742
743
744 <li class="md-nav__item">
745 <a href="../../package_installation_plugins/" class="md-nav__link">
746 Package Installation Plugins
747 </a>
748 </li>
749
750
751
752
753
754
755
756 <li class="md-nav__item">
757 <a href="../../user_activity_points/" class="md-nav__link">
758 User Activity Points
759 </a>
760 </li>
761
762
763
764
765
766
767
768 <li class="md-nav__item">
769 <a href="../../user_notifications/" class="md-nav__link">
770 User Notifications
771 </a>
772 </li>
773
774
775
776
777
778
779
780 <li class="md-nav__item">
781 <a href="../../sitemaps/" class="md-nav__link">
782 Sitemaps
783 </a>
784 </li>
785
786
787
788 </ul>
789 </nav>
790 </li>
791
792
793
794
795
796
797
798 <li class="md-nav__item">
799 <a href="../../../code-style/" class="md-nav__link">
800 Code Style
801 </a>
802 </li>
803
804
805
806
807
808
809
810 <li class="md-nav__item">
811 <a href="../../../apps/" class="md-nav__link">
812 Apps
813 </a>
814 </li>
815
816
817
818
819
820
821
822 <li class="md-nav__item">
823 <a href="../../../gdpr/" class="md-nav__link">
824 GDPR
825 </a>
826 </li>
827
828
829
830 </ul>
831 </nav>
832 </li>
833
834
835
836
837
838
839
840
841
842
843
844 <li class="md-nav__item md-nav__item--nested">
845
846
847 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
848
849 <label class="md-nav__link" for="__nav_3">
850 Languages, Templates & CSS
851 <span class="md-nav__icon md-icon"></span>
852 </label>
853 <nav class="md-nav" aria-label="Languages, Templates & CSS" data-md-level="1">
854 <label class="md-nav__title" for="__nav_3">
855 <span class="md-nav__icon md-icon"></span>
856 Languages, Templates & CSS
857 </label>
858 <ul class="md-nav__list" data-md-scrollfix>
859
860
861
862
863
864 <li class="md-nav__item">
865 <a href="../../../../view/languages/" class="md-nav__link">
866 Languages
867 </a>
868 </li>
869
870
871
872
873
874
875
876 <li class="md-nav__item">
877 <a href="../../../../view/templates/" class="md-nav__link">
878 Templates
879 </a>
880 </li>
881
882
883
884
885
886
887
888 <li class="md-nav__item">
889 <a href="../../../../view/css/" class="md-nav__link">
890 CSS
891 </a>
892 </li>
893
894
895
896 </ul>
897 </nav>
898 </li>
899
900
901
902
903
904
905
906
907
908
909
910 <li class="md-nav__item md-nav__item--nested">
911
912
913 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
914
915 <label class="md-nav__link" for="__nav_4">
916 TypeScript and JavaScript API
917 <span class="md-nav__icon md-icon"></span>
918 </label>
919 <nav class="md-nav" aria-label="TypeScript and JavaScript API" data-md-level="1">
920 <label class="md-nav__title" for="__nav_4">
921 <span class="md-nav__icon md-icon"></span>
922 TypeScript and JavaScript API
923 </label>
924 <ul class="md-nav__list" data-md-scrollfix>
925
926
927
928
929
930 <li class="md-nav__item">
931 <a href="../../../../javascript/general-usage/" class="md-nav__link">
932 General Usage
933 </a>
934 </li>
935
936
937
938
939
940
941
942 <li class="md-nav__item">
943 <a href="../../../../javascript/typescript/" class="md-nav__link">
944 TypeScript
945 </a>
946 </li>
947
948
949
950
951
952
953
954
955 <li class="md-nav__item md-nav__item--nested">
956
957
958 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_3" type="checkbox" id="__nav_4_3" >
959
960 <label class="md-nav__link" for="__nav_4_3">
961 New API
962 <span class="md-nav__icon md-icon"></span>
963 </label>
964 <nav class="md-nav" aria-label="New API" data-md-level="2">
965 <label class="md-nav__title" for="__nav_4_3">
966 <span class="md-nav__icon md-icon"></span>
967 New API
968 </label>
969 <ul class="md-nav__list" data-md-scrollfix>
970
971
972
973
974
975 <li class="md-nav__item">
976 <a href="../../../../javascript/new-api_writing-a-module/" class="md-nav__link">
977 Writing a module
978 </a>
979 </li>
980
981
982
983
984
985
986
987 <li class="md-nav__item">
988 <a href="../../../../javascript/new-api_data-structures/" class="md-nav__link">
989 Data Structures
990 </a>
991 </li>
992
993
994
995
996
997
998
999 <li class="md-nav__item">
1000 <a href="../../../../javascript/new-api_core/" class="md-nav__link">
1001 Core Functions
1002 </a>
1003 </li>
1004
1005
1006
1007
1008
1009
1010
1011 <li class="md-nav__item">
1012 <a href="../../../../javascript/new-api_dom/" class="md-nav__link">
1013 DOM
1014 </a>
1015 </li>
1016
1017
1018
1019
1020
1021
1022
1023 <li class="md-nav__item">
1024 <a href="../../../../javascript/new-api_events/" class="md-nav__link">
1025 Event Handling
1026 </a>
1027 </li>
1028
1029
1030
1031
1032
1033
1034
1035 <li class="md-nav__item">
1036 <a href="../../../../javascript/new-api_ajax/" class="md-nav__link">
1037 Ajax
1038 </a>
1039 </li>
1040
1041
1042
1043
1044
1045
1046
1047 <li class="md-nav__item">
1048 <a href="../../../../javascript/new-api_dialogs/" class="md-nav__link">
1049 Dialogs
1050 </a>
1051 </li>
1052
1053
1054
1055
1056
1057
1058
1059 <li class="md-nav__item">
1060 <a href="../../../../javascript/new-api_browser/" class="md-nav__link">
1061 Browser and Screen Sizes
1062 </a>
1063 </li>
1064
1065
1066
1067
1068
1069
1070
1071 <li class="md-nav__item">
1072 <a href="../../../../javascript/new-api_ui/" class="md-nav__link">
1073 User Interface
1074 </a>
1075 </li>
1076
1077
1078
1079 </ul>
1080 </nav>
1081 </li>
1082
1083
1084
1085
1086
1087
1088
1089 <li class="md-nav__item">
1090 <a href="../../../../javascript/legacy-api/" class="md-nav__link">
1091 Legacy API
1092 </a>
1093 </li>
1094
1095
1096
1097
1098
1099
1100
1101 <li class="md-nav__item">
1102 <a href="../../../../javascript/helper-functions/" class="md-nav__link">
1103 Helper Functions
1104 </a>
1105 </li>
1106
1107
1108
1109
1110
1111
1112
1113 <li class="md-nav__item">
1114 <a href="../../../../javascript/code-snippets/" class="md-nav__link">
1115 Code Snippets
1116 </a>
1117 </li>
1118
1119
1120
1121 </ul>
1122 </nav>
1123 </li>
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135 <li class="md-nav__item md-nav__item--nested">
1136
1137
1138 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
1139
1140 <label class="md-nav__link" for="__nav_5">
1141 Package Components
1142 <span class="md-nav__icon md-icon"></span>
1143 </label>
1144 <nav class="md-nav" aria-label="Package Components" data-md-level="1">
1145 <label class="md-nav__title" for="__nav_5">
1146 <span class="md-nav__icon md-icon"></span>
1147 Package Components
1148 </label>
1149 <ul class="md-nav__list" data-md-scrollfix>
1150
1151
1152
1153
1154
1155 <li class="md-nav__item">
1156 <a href="../../../../package/package-xml/" class="md-nav__link">
1157 package.xml
1158 </a>
1159 </li>
1160
1161
1162
1163
1164
1165
1166
1167
1168 <li class="md-nav__item md-nav__item--nested">
1169
1170
1171 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" >
1172
1173 <label class="md-nav__link" for="__nav_5_2">
1174 PIPs
1175 <span class="md-nav__icon md-icon"></span>
1176 </label>
1177 <nav class="md-nav" aria-label="PIPs" data-md-level="2">
1178 <label class="md-nav__title" for="__nav_5_2">
1179 <span class="md-nav__icon md-icon"></span>
1180 PIPs
1181 </label>
1182 <ul class="md-nav__list" data-md-scrollfix>
1183
1184
1185
1186
1187
1188 <li class="md-nav__item">
1189 <a href="../../../../package/pip/" class="md-nav__link">
1190 Overview
1191 </a>
1192 </li>
1193
1194
1195
1196
1197
1198
1199
1200 <li class="md-nav__item">
1201 <a href="../../../../package/pip/acl-option/" class="md-nav__link">
1202 aclOption
1203 </a>
1204 </li>
1205
1206
1207
1208
1209
1210
1211
1212 <li class="md-nav__item">
1213 <a href="../../../../package/pip/acp-menu/" class="md-nav__link">
1214 acpMenu
1215 </a>
1216 </li>
1217
1218
1219
1220
1221
1222
1223
1224 <li class="md-nav__item">
1225 <a href="../../../../package/pip/acp-search-provider/" class="md-nav__link">
1226 acpSearchProvider
1227 </a>
1228 </li>
1229
1230
1231
1232
1233
1234
1235
1236 <li class="md-nav__item">
1237 <a href="../../../../package/pip/acp-template/" class="md-nav__link">
1238 acpTemplate
1239 </a>
1240 </li>
1241
1242
1243
1244
1245
1246
1247
1248 <li class="md-nav__item">
1249 <a href="../../../../package/pip/bbcode/" class="md-nav__link">
1250 bbcode
1251 </a>
1252 </li>
1253
1254
1255
1256
1257
1258
1259
1260 <li class="md-nav__item">
1261 <a href="../../../../package/pip/box/" class="md-nav__link">
1262 box
1263 </a>
1264 </li>
1265
1266
1267
1268
1269
1270
1271
1272 <li class="md-nav__item">
1273 <a href="../../../../package/pip/clipboard-action/" class="md-nav__link">
1274 clipboardAction
1275 </a>
1276 </li>
1277
1278
1279
1280
1281
1282
1283
1284 <li class="md-nav__item">
1285 <a href="../../../../package/pip/core-object/" class="md-nav__link">
1286 coreObject
1287 </a>
1288 </li>
1289
1290
1291
1292
1293
1294
1295
1296 <li class="md-nav__item">
1297 <a href="../../../../package/pip/cronjob/" class="md-nav__link">
1298 cronjob
1299 </a>
1300 </li>
1301
1302
1303
1304
1305
1306
1307
1308 <li class="md-nav__item">
1309 <a href="../../../../package/pip/event-listener/" class="md-nav__link">
1310 eventListener
1311 </a>
1312 </li>
1313
1314
1315
1316
1317
1318
1319
1320 <li class="md-nav__item">
1321 <a href="../../../../package/pip/file/" class="md-nav__link">
1322 file
1323 </a>
1324 </li>
1325
1326
1327
1328
1329
1330
1331
1332 <li class="md-nav__item">
1333 <a href="../../../../package/pip/language/" class="md-nav__link">
1334 language
1335 </a>
1336 </li>
1337
1338
1339
1340
1341
1342
1343
1344 <li class="md-nav__item">
1345 <a href="../../../../package/pip/media-provider/" class="md-nav__link">
1346 mediaProvider
1347 </a>
1348 </li>
1349
1350
1351
1352
1353
1354
1355
1356 <li class="md-nav__item">
1357 <a href="../../../../package/pip/menu/" class="md-nav__link">
1358 menu
1359 </a>
1360 </li>
1361
1362
1363
1364
1365
1366
1367
1368 <li class="md-nav__item">
1369 <a href="../../../../package/pip/menu-item/" class="md-nav__link">
1370 menuItem
1371 </a>
1372 </li>
1373
1374
1375
1376
1377
1378
1379
1380 <li class="md-nav__item">
1381 <a href="../../../../package/pip/object-type/" class="md-nav__link">
1382 objectType
1383 </a>
1384 </li>
1385
1386
1387
1388
1389
1390
1391
1392 <li class="md-nav__item">
1393 <a href="../../../../package/pip/object-type-definition/" class="md-nav__link">
1394 objectTypeDefinition
1395 </a>
1396 </li>
1397
1398
1399
1400
1401
1402
1403
1404 <li class="md-nav__item">
1405 <a href="../../../../package/pip/option/" class="md-nav__link">
1406 option
1407 </a>
1408 </li>
1409
1410
1411
1412
1413
1414
1415
1416 <li class="md-nav__item">
1417 <a href="../../../../package/pip/page/" class="md-nav__link">
1418 page
1419 </a>
1420 </li>
1421
1422
1423
1424
1425
1426
1427
1428 <li class="md-nav__item">
1429 <a href="../../../../package/pip/pip/" class="md-nav__link">
1430 pip
1431 </a>
1432 </li>
1433
1434
1435
1436
1437
1438
1439
1440 <li class="md-nav__item">
1441 <a href="../../../../package/pip/script/" class="md-nav__link">
1442 script
1443 </a>
1444 </li>
1445
1446
1447
1448
1449
1450
1451
1452 <li class="md-nav__item">
1453 <a href="../../../../package/pip/smiley/" class="md-nav__link">
1454 smiley
1455 </a>
1456 </li>
1457
1458
1459
1460
1461
1462
1463
1464 <li class="md-nav__item">
1465 <a href="../../../../package/pip/sql/" class="md-nav__link">
1466 sql
1467 </a>
1468 </li>
1469
1470
1471
1472
1473
1474
1475
1476 <li class="md-nav__item">
1477 <a href="../../../../package/pip/style/" class="md-nav__link">
1478 style
1479 </a>
1480 </li>
1481
1482
1483
1484
1485
1486
1487
1488 <li class="md-nav__item">
1489 <a href="../../../../package/pip/template/" class="md-nav__link">
1490 template
1491 </a>
1492 </li>
1493
1494
1495
1496
1497
1498
1499
1500 <li class="md-nav__item">
1501 <a href="../../../../package/pip/template-listener/" class="md-nav__link">
1502 templateListener
1503 </a>
1504 </li>
1505
1506
1507
1508
1509
1510
1511
1512 <li class="md-nav__item">
1513 <a href="../../../../package/pip/user-group-option/" class="md-nav__link">
1514 userGroupOption
1515 </a>
1516 </li>
1517
1518
1519
1520
1521
1522
1523
1524 <li class="md-nav__item">
1525 <a href="../../../../package/pip/user-menu/" class="md-nav__link">
1526 userMenu
1527 </a>
1528 </li>
1529
1530
1531
1532
1533
1534
1535
1536 <li class="md-nav__item">
1537 <a href="../../../../package/pip/user-notification-event/" class="md-nav__link">
1538 userNotificationEvent
1539 </a>
1540 </li>
1541
1542
1543
1544
1545
1546
1547
1548 <li class="md-nav__item">
1549 <a href="../../../../package/pip/user-option/" class="md-nav__link">
1550 userOption
1551 </a>
1552 </li>
1553
1554
1555
1556
1557
1558
1559
1560 <li class="md-nav__item">
1561 <a href="../../../../package/pip/user-profile-menu/" class="md-nav__link">
1562 userProfileMenu
1563 </a>
1564 </li>
1565
1566
1567
1568 </ul>
1569 </nav>
1570 </li>
1571
1572
1573
1574
1575
1576
1577
1578 <li class="md-nav__item">
1579 <a href="../../../../package/database-php-api/" class="md-nav__link">
1580 Database PHP API
1581 </a>
1582 </li>
1583
1584
1585
1586 </ul>
1587 </nav>
1588 </li>
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600 <li class="md-nav__item md-nav__item--nested">
1601
1602
1603 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
1604
1605 <label class="md-nav__link" for="__nav_6">
1606 Migration
1607 <span class="md-nav__icon md-icon"></span>
1608 </label>
1609 <nav class="md-nav" aria-label="Migration" data-md-level="1">
1610 <label class="md-nav__title" for="__nav_6">
1611 <span class="md-nav__icon md-icon"></span>
1612 Migration
1613 </label>
1614 <ul class="md-nav__list" data-md-scrollfix>
1615
1616
1617
1618
1619
1620
1621 <li class="md-nav__item md-nav__item--nested">
1622
1623
1624 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_1" type="checkbox" id="__nav_6_1" >
1625
1626 <label class="md-nav__link" for="__nav_6_1">
1627 Migrating from WSC 5.3
1628 <span class="md-nav__icon md-icon"></span>
1629 </label>
1630 <nav class="md-nav" aria-label="Migrating from WSC 5.3" data-md-level="2">
1631 <label class="md-nav__title" for="__nav_6_1">
1632 <span class="md-nav__icon md-icon"></span>
1633 Migrating from WSC 5.3
1634 </label>
1635 <ul class="md-nav__list" data-md-scrollfix>
1636
1637
1638
1639
1640
1641 <li class="md-nav__item">
1642 <a href="../../../../migration/wsc53/php/" class="md-nav__link">
1643 PHP API
1644 </a>
1645 </li>
1646
1647
1648
1649
1650
1651
1652
1653 <li class="md-nav__item">
1654 <a href="../../../../migration/wsc53/session/" class="md-nav__link">
1655 Session Handling and Authentication
1656 </a>
1657 </li>
1658
1659
1660
1661
1662
1663
1664
1665 <li class="md-nav__item">
1666 <a href="../../../../migration/wsc53/javascript/" class="md-nav__link">
1667 TypeScript and JavaScript
1668 </a>
1669 </li>
1670
1671
1672
1673
1674
1675
1676
1677 <li class="md-nav__item">
1678 <a href="../../../../migration/wsc53/templates/" class="md-nav__link">
1679 Templates
1680 </a>
1681 </li>
1682
1683
1684
1685
1686
1687
1688
1689 <li class="md-nav__item">
1690 <a href="../../../../migration/wsc53/libraries/" class="md-nav__link">
1691 Third Party Libraries
1692 </a>
1693 </li>
1694
1695
1696
1697 </ul>
1698 </nav>
1699 </li>
1700
1701
1702
1703
1704
1705
1706
1707
1708 <li class="md-nav__item md-nav__item--nested">
1709
1710
1711 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_2" type="checkbox" id="__nav_6_2" >
1712
1713 <label class="md-nav__link" for="__nav_6_2">
1714 Migrating from WSC 5.2
1715 <span class="md-nav__icon md-icon"></span>
1716 </label>
1717 <nav class="md-nav" aria-label="Migrating from WSC 5.2" data-md-level="2">
1718 <label class="md-nav__title" for="__nav_6_2">
1719 <span class="md-nav__icon md-icon"></span>
1720 Migrating from WSC 5.2
1721 </label>
1722 <ul class="md-nav__list" data-md-scrollfix>
1723
1724
1725
1726
1727
1728 <li class="md-nav__item">
1729 <a href="../../../../migration/wsc52/php/" class="md-nav__link">
1730 PHP API
1731 </a>
1732 </li>
1733
1734
1735
1736
1737
1738
1739
1740 <li class="md-nav__item">
1741 <a href="../../../../migration/wsc52/templates/" class="md-nav__link">
1742 Templates and Languages
1743 </a>
1744 </li>
1745
1746
1747
1748
1749
1750
1751
1752 <li class="md-nav__item">
1753 <a href="../../../../migration/wsc52/libraries/" class="md-nav__link">
1754 Third Party Libraries
1755 </a>
1756 </li>
1757
1758
1759
1760 </ul>
1761 </nav>
1762 </li>
1763
1764
1765
1766
1767
1768
1769
1770
1771 <li class="md-nav__item md-nav__item--nested">
1772
1773
1774 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_3" type="checkbox" id="__nav_6_3" >
1775
1776 <label class="md-nav__link" for="__nav_6_3">
1777 Migrating from WSC 3.1
1778 <span class="md-nav__icon md-icon"></span>
1779 </label>
1780 <nav class="md-nav" aria-label="Migrating from WSC 3.1" data-md-level="2">
1781 <label class="md-nav__title" for="__nav_6_3">
1782 <span class="md-nav__icon md-icon"></span>
1783 Migrating from WSC 3.1
1784 </label>
1785 <ul class="md-nav__list" data-md-scrollfix>
1786
1787
1788
1789
1790
1791 <li class="md-nav__item">
1792 <a href="../../../../migration/wsc31/php/" class="md-nav__link">
1793 PHP API
1794 </a>
1795 </li>
1796
1797
1798
1799 </ul>
1800 </nav>
1801 </li>
1802
1803
1804
1805
1806
1807
1808
1809
1810 <li class="md-nav__item md-nav__item--nested">
1811
1812
1813 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_4" type="checkbox" id="__nav_6_4" >
1814
1815 <label class="md-nav__link" for="__nav_6_4">
1816 Migrating from WSC 3.0
1817 <span class="md-nav__icon md-icon"></span>
1818 </label>
1819 <nav class="md-nav" aria-label="Migrating from WSC 3.0" data-md-level="2">
1820 <label class="md-nav__title" for="__nav_6_4">
1821 <span class="md-nav__icon md-icon"></span>
1822 Migrating from WSC 3.0
1823 </label>
1824 <ul class="md-nav__list" data-md-scrollfix>
1825
1826
1827
1828
1829
1830 <li class="md-nav__item">
1831 <a href="../../../../migration/wsc30/php/" class="md-nav__link">
1832 PHP API
1833 </a>
1834 </li>
1835
1836
1837
1838
1839
1840
1841
1842 <li class="md-nav__item">
1843 <a href="../../../../migration/wsc30/javascript/" class="md-nav__link">
1844 JavaScript API
1845 </a>
1846 </li>
1847
1848
1849
1850
1851
1852
1853
1854 <li class="md-nav__item">
1855 <a href="../../../../migration/wsc30/templates/" class="md-nav__link">
1856 Templates
1857 </a>
1858 </li>
1859
1860
1861
1862
1863
1864
1865
1866 <li class="md-nav__item">
1867 <a href="../../../../migration/wsc30/css/" class="md-nav__link">
1868 CSS
1869 </a>
1870 </li>
1871
1872
1873
1874
1875
1876
1877
1878 <li class="md-nav__item">
1879 <a href="../../../../migration/wsc30/package/" class="md-nav__link">
1880 Package Components
1881 </a>
1882 </li>
1883
1884
1885
1886 </ul>
1887 </nav>
1888 </li>
1889
1890
1891
1892
1893
1894
1895
1896
1897 <li class="md-nav__item md-nav__item--nested">
1898
1899
1900 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_5" type="checkbox" id="__nav_6_5" >
1901
1902 <label class="md-nav__link" for="__nav_6_5">
1903 Migrating from WCF 2.1
1904 <span class="md-nav__icon md-icon"></span>
1905 </label>
1906 <nav class="md-nav" aria-label="Migrating from WCF 2.1" data-md-level="2">
1907 <label class="md-nav__title" for="__nav_6_5">
1908 <span class="md-nav__icon md-icon"></span>
1909 Migrating from WCF 2.1
1910 </label>
1911 <ul class="md-nav__list" data-md-scrollfix>
1912
1913
1914
1915
1916
1917 <li class="md-nav__item">
1918 <a href="../../../../migration/wcf21/php/" class="md-nav__link">
1919 PHP API
1920 </a>
1921 </li>
1922
1923
1924
1925
1926
1927
1928
1929 <li class="md-nav__item">
1930 <a href="../../../../migration/wcf21/templates/" class="md-nav__link">
1931 Templates
1932 </a>
1933 </li>
1934
1935
1936
1937
1938
1939
1940
1941 <li class="md-nav__item">
1942 <a href="../../../../migration/wcf21/css/" class="md-nav__link">
1943 CSS
1944 </a>
1945 </li>
1946
1947
1948
1949
1950
1951
1952
1953 <li class="md-nav__item">
1954 <a href="../../../../migration/wcf21/package/" class="md-nav__link">
1955 Package Components
1956 </a>
1957 </li>
1958
1959
1960
1961 </ul>
1962 </nav>
1963 </li>
1964
1965
1966
1967 </ul>
1968 </nav>
1969 </li>
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981 <li class="md-nav__item md-nav__item--nested">
1982
1983
1984 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
1985
1986 <label class="md-nav__link" for="__nav_7">
1987 Tutorials
1988 <span class="md-nav__icon md-icon"></span>
1989 </label>
1990 <nav class="md-nav" aria-label="Tutorials" data-md-level="1">
1991 <label class="md-nav__title" for="__nav_7">
1992 <span class="md-nav__icon md-icon"></span>
1993 Tutorials
1994 </label>
1995 <ul class="md-nav__list" data-md-scrollfix>
1996
1997
1998
1999
2000
2001
2002 <li class="md-nav__item md-nav__item--nested">
2003
2004
2005 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_1" type="checkbox" id="__nav_7_1" >
2006
2007 <label class="md-nav__link" for="__nav_7_1">
2008 Tutorial Series
2009 <span class="md-nav__icon md-icon"></span>
2010 </label>
2011 <nav class="md-nav" aria-label="Tutorial Series" data-md-level="2">
2012 <label class="md-nav__title" for="__nav_7_1">
2013 <span class="md-nav__icon md-icon"></span>
2014 Tutorial Series
2015 </label>
2016 <ul class="md-nav__list" data-md-scrollfix>
2017
2018
2019
2020
2021
2022 <li class="md-nav__item">
2023 <a href="../../../../tutorial/series/overview/" class="md-nav__link">
2024 Overview
2025 </a>
2026 </li>
2027
2028
2029
2030
2031
2032
2033
2034 <li class="md-nav__item">
2035 <a href="../../../../tutorial/series/part_1/" class="md-nav__link">
2036 Part 1
2037 </a>
2038 </li>
2039
2040
2041
2042
2043
2044
2045
2046 <li class="md-nav__item">
2047 <a href="../../../../tutorial/series/part_2/" class="md-nav__link">
2048 Part 2
2049 </a>
2050 </li>
2051
2052
2053
2054
2055
2056
2057
2058 <li class="md-nav__item">
2059 <a href="../../../../tutorial/series/part_3/" class="md-nav__link">
2060 Part 3
2061 </a>
2062 </li>
2063
2064
2065
2066 </ul>
2067 </nav>
2068 </li>
2069
2070
2071
2072 </ul>
2073 </nav>
2074 </li>
2075
2076
2077
2078 </ul>
2079 </nav>
2080 </div>
2081 </div>
2082 </div>
2083
2084
2085
2086 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
2087 <div class="md-sidebar__scrollwrap">
2088 <div class="md-sidebar__inner">
2089
2090 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
2091
2092
2093
2094
2095
2096 <label class="md-nav__title" for="__toc">
2097 <span class="md-nav__icon md-icon"></span>
2098 Table of contents
2099 </label>
2100 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
2101
2102 <li class="md-nav__item">
2103 <a href="#form-nodes" class="md-nav__link">
2104 Form Nodes
2105 </a>
2106
2107 <nav class="md-nav" aria-label="Form Nodes">
2108 <ul class="md-nav__list">
2109
2110 <li class="md-nav__item">
2111 <a href="#iformnode" class="md-nav__link">
2112 IFormNode
2113 </a>
2114
2115 </li>
2116
2117 <li class="md-nav__item">
2118 <a href="#iformchildnode" class="md-nav__link">
2119 IFormChildNode
2120 </a>
2121
2122 </li>
2123
2124 <li class="md-nav__item">
2125 <a href="#iformparentnode" class="md-nav__link">
2126 IFormParentNode
2127 </a>
2128
2129 </li>
2130
2131 <li class="md-nav__item">
2132 <a href="#iformelement" class="md-nav__link">
2133 IFormElement
2134 </a>
2135
2136 </li>
2137
2138 <li class="md-nav__item">
2139 <a href="#iobjecttypeformnode" class="md-nav__link">
2140 IObjectTypeFormNode
2141 </a>
2142
2143 </li>
2144
2145 <li class="md-nav__item">
2146 <a href="#customformnode" class="md-nav__link">
2147 CustomFormNode
2148 </a>
2149
2150 </li>
2151
2152 <li class="md-nav__item">
2153 <a href="#templateformnode" class="md-nav__link">
2154 TemplateFormNode
2155 </a>
2156
2157 </li>
2158
2159 </ul>
2160 </nav>
2161
2162 </li>
2163
2164 <li class="md-nav__item">
2165 <a href="#form-document" class="md-nav__link">
2166 Form Document
2167 </a>
2168
2169 </li>
2170
2171 <li class="md-nav__item">
2172 <a href="#form-button" class="md-nav__link">
2173 Form Button
2174 </a>
2175
2176 </li>
2177
2178 <li class="md-nav__item">
2179 <a href="#form-container" class="md-nav__link">
2180 Form Container
2181 </a>
2182
2183 </li>
2184
2185 <li class="md-nav__item">
2186 <a href="#form-field" class="md-nav__link">
2187 Form Field
2188 </a>
2189
2190 <nav class="md-nav" aria-label="Form Field">
2191 <ul class="md-nav__list">
2192
2193 <li class="md-nav__item">
2194 <a href="#form-field-interfaces-and-traits" class="md-nav__link">
2195 Form Field Interfaces and Traits
2196 </a>
2197
2198 <nav class="md-nav" aria-label="Form Field Interfaces and Traits">
2199 <ul class="md-nav__list">
2200
2201 <li class="md-nav__item">
2202 <a href="#iattributeformfield" class="md-nav__link">
2203 IAttributeFormField
2204 </a>
2205
2206 </li>
2207
2208 <li class="md-nav__item">
2209 <a href="#iautocompleteformfield" class="md-nav__link">
2210 IAutoCompleteFormField
2211 </a>
2212
2213 </li>
2214
2215 <li class="md-nav__item">
2216 <a href="#iautofocusformfield" class="md-nav__link">
2217 IAutoFocusFormField
2218 </a>
2219
2220 </li>
2221
2222 <li class="md-nav__item">
2223 <a href="#icssclassformfield" class="md-nav__link">
2224 ICssClassFormField
2225 </a>
2226
2227 </li>
2228
2229 <li class="md-nav__item">
2230 <a href="#ifileformfield" class="md-nav__link">
2231 IFileFormField
2232 </a>
2233
2234 </li>
2235
2236 <li class="md-nav__item">
2237 <a href="#ifilterableselectionformfield" class="md-nav__link">
2238 IFilterableSelectionFormField
2239 </a>
2240
2241 </li>
2242
2243 <li class="md-nav__item">
2244 <a href="#ii18nformfield" class="md-nav__link">
2245 II18nFormField
2246 </a>
2247
2248 </li>
2249
2250 <li class="md-nav__item">
2251 <a href="#iimmutableformfield" class="md-nav__link">
2252 IImmutableFormField
2253 </a>
2254
2255 </li>
2256
2257 <li class="md-nav__item">
2258 <a href="#iinputmodeformfield" class="md-nav__link">
2259 IInputModeFormField
2260 </a>
2261
2262 </li>
2263
2264 <li class="md-nav__item">
2265 <a href="#imaximumformfield" class="md-nav__link">
2266 IMaximumFormField
2267 </a>
2268
2269 </li>
2270
2271 <li class="md-nav__item">
2272 <a href="#imaximumlengthformfield" class="md-nav__link">
2273 IMaximumLengthFormField
2274 </a>
2275
2276 </li>
2277
2278 <li class="md-nav__item">
2279 <a href="#iminimumformfield" class="md-nav__link">
2280 IMinimumFormField
2281 </a>
2282
2283 </li>
2284
2285 <li class="md-nav__item">
2286 <a href="#iminimumlengthformfield" class="md-nav__link">
2287 IMinimumLengthFormField
2288 </a>
2289
2290 </li>
2291
2292 <li class="md-nav__item">
2293 <a href="#imultipleformfield" class="md-nav__link">
2294 IMultipleFormField
2295 </a>
2296
2297 </li>
2298
2299 <li class="md-nav__item">
2300 <a href="#inullableformfield" class="md-nav__link">
2301 INullableFormField
2302 </a>
2303
2304 </li>
2305
2306 <li class="md-nav__item">
2307 <a href="#ipackagesformfield" class="md-nav__link">
2308 IPackagesFormField
2309 </a>
2310
2311 </li>
2312
2313 <li class="md-nav__item">
2314 <a href="#ipatternformfield" class="md-nav__link">
2315 IPatternFormField
2316 </a>
2317
2318 </li>
2319
2320 <li class="md-nav__item">
2321 <a href="#iplaceholderformfield" class="md-nav__link">
2322 IPlaceholderFormField
2323 </a>
2324
2325 </li>
2326
2327 <li class="md-nav__item">
2328 <a href="#iselectionformfield" class="md-nav__link">
2329 ISelectionFormField
2330 </a>
2331
2332 </li>
2333
2334 <li class="md-nav__item">
2335 <a href="#isuffixedformfield" class="md-nav__link">
2336 ISuffixedFormField
2337 </a>
2338
2339 </li>
2340
2341 <li class="md-nav__item">
2342 <a href="#tdefaultidformfield" class="md-nav__link">
2343 TDefaultIdFormField
2344 </a>
2345
2346 </li>
2347
2348 </ul>
2349 </nav>
2350
2351 </li>
2352
2353 </ul>
2354 </nav>
2355
2356 </li>
2357
2358 <li class="md-nav__item">
2359 <a href="#displaying-forms" class="md-nav__link">
2360 Displaying Forms
2361 </a>
2362
2363 </li>
2364
2365 </ul>
2366
2367 </nav>
2368 </div>
2369 </div>
2370 </div>
2371
2372
2373 <div class="md-content" data-md-component="content">
2374 <article class="md-content__inner md-typeset">
2375
2376
2377 <a href="https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/php/api/form_builder/structure.md" title="Edit this page" class="md-content__button md-icon">
2378 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20.71 7.04c.39-.39.39-1.04 0-1.41l-2.34-2.34c-.37-.39-1.02-.39-1.41 0l-1.84 1.83 3.75 3.75M3 17.25V21h3.75L17.81 9.93l-3.75-3.75L3 17.25z"/></svg>
2379 </a>
2380
2381
2382 <h1 id="structure-of-form-builder">Structure of Form Builder<a class="headerlink" href="#structure-of-form-builder" title="Permanent link">#</a></h1>
2383 <p>Forms built with form builder consist of three major structural elements listed from top to bottom:</p>
2384 <ol>
2385 <li>form document,</li>
2386 <li>form container,</li>
2387 <li>form field.</li>
2388 </ol>
2389 <p>The basis for all three elements are form nodes.</p>
2390 <div class="admonition info">
2391 <p class="admonition-title">The form builder API uses fluent interfaces heavily, meaning that unless a method is a getter, it generally returns the objects itself to support method chaining.</p>
2392 </div>
2393 <h2 id="form-nodes">Form Nodes<a class="headerlink" href="#form-nodes" title="Permanent link">#</a></h2>
2394 <ul>
2395 <li><code>IFormNode</code> is the base interface that any node of a form has to implement.</li>
2396 <li><code>IFormChildNode</code> extends <code>IFormNode</code> for such elements of a form that can be a child node to a parent node.</li>
2397 <li><code>IFormParentNode</code> extends <code>IFormNode</code> for such elements of a form that can be a parent to child nodes.</li>
2398 <li><code>IFormElement</code> extends <code>IFormNode</code> for such elements of a form that can have a description and a label.</li>
2399 </ul>
2400 <h3 id="iformnode"><code>IFormNode</code><a class="headerlink" href="#iformnode" title="Permanent link">#</a></h3>
2401 <p><code>IFormNode</code> is the base interface that any node of a form has to implement and it requires the following methods:</p>
2402 <ul>
2403 <li><code>addClass($class)</code>, <code>addClasses(array $classes)</code>, <code>removeClass($class)</code>, <code>getClasses()</code>, and <code>hasClass($class)</code> add, remove, get, and check for CSS classes of the HTML element representing the form node.
2404 If the form node consists of multiple (nested) HTML elements, the classes are generally added to the top element.
2405 <code>static validateClass($class)</code> is used to check if a given CSS class is valid.
2406 By default, a form node has no CSS classes.</li>
2407 <li><code>addDependency(IFormFieldDependency $dependency)</code>, <code>removeDependency($dependencyId)</code>, <code>getDependencies()</code>, and <code>hasDependency($dependencyId)</code> add, remove, get, and check for dependencies of this form node on other form fields.
2408 <code>checkDependencies()</code> checks if <strong>all</strong> of the node’s dependencies are met and returns a boolean value reflecting the check’s result.
2409 The <a href="../dependencies/">form builder dependency documentation</a> provides more detailed information about dependencies and how they work.
2410 By default, a form node has no dependencies.</li>
2411 <li><code>attribute($name, $value = null)</code>, <code>removeAttribute($name)</code>, <code>getAttribute($name)</code>, <code>getAttributes()</code>, <code>hasAttribute($name)</code> add, remove, get, and check for attributes of the HTML element represting the form node.
2412 The attributes are added to the same element that the CSS classes are added to.
2413 <code>static validateAttribute($name)</code> is used to check if a given attribute is valid.
2414 By default, a form node has no attributes.</li>
2415 <li><code>available($available = true)</code> and <code>isAvailable()</code> can be used to set and check if the node is available.
2416 The availability functionality can be used to easily toggle form nodes based, for example, on options without having to create a condition to append the relevant.
2417 This way of checking availability makes it easier to set up forms.
2418 By default, every form node is available.</li>
2419 </ul>
2420 <p>The following aspects are important when working with availability:</p>
2421 <ul>
2422 <li>Unavailable fields produce no output, their value is not read, they are not validated and they are not checked for save values.</li>
2423 <li>Form fields are also able to mark themselves as unavailable, for example, a selection field without any options.</li>
2424 <li>Form containers are automatically unavailable if they contain no available children.</li>
2425 </ul>
2426 <p>Availability sets the static availability for form nodes that does not change during the lifetime of a form.
2427 In contrast, dependencies represent a dynamic availability for form nodes that depends on the current value of certain form fields.
2428 - <code>cleanup()</code> is called after the whole form is not used anymore to reset other APIs if the form fields depends on them and they expect such a reset.
2429 This method is not intended to clean up the form field’s value as a new form document object is created to show a clean form.
2430 - <code>getDocument()</code> returns the <code>IFormDocument</code> object the node belongs to.
2431 (As <code>IFormDocument</code> extends <code>IFormNode</code>, form document objects simply return themselves.)
2432 - <code>getHtml()</code> returns the HTML representation of the node.
2433 <code>getHtmlVariables()</code> return template variables (in addition to the form node itself) to render the node’s HTML representation.
2434 - <code>id($id)</code> and <code>getId()</code> set and get the id of the form node.
2435 Every id has to be unique within a form.
2436 <code>getPrefixedId()</code> returns the prefixed version of the node’s id (see <code>IFormDocument::getPrefix()</code> and <code>IFormDocument::prefix()</code>).
2437 <code>static validateId($id)</code> is used to check if a given id is valid.
2438 - <code>populate()</code> is called by <code>IFormDocument::build()</code> after all form nodes have been added.
2439 This method should finilize the initialization of the form node after all parent-child relations of the form document have been established.
2440 This method is needed because during the construction of a form node, it neither knows the form document it will belong to nor does it know its parent.
2441 - <code>validate()</code> checks, after the form is submitted, if the form node is valid.
2442 A form node with children is valid if all of its child nodes are valid.
2443 A form field is valid if its value is valid.
2444 - <code>static create($id)</code> is the factory method that has to be used to create new form nodes with the given id.</p>
2445 <p><code>TFormNode</code> provides a default implementation of most of these methods.</p>
2446 <h3 id="iformchildnode"><code>IFormChildNode</code><a class="headerlink" href="#iformchildnode" title="Permanent link">#</a></h3>
2447 <p><code>IFormChildNode</code> extends <code>IFormNode</code> for such elements of a form that can be a child node to a parent node and it requires the <code>parent(IFormParentNode $parentNode)</code> and <code>getParent()</code> methods used to set and get the node’s parent node.
2448 <code>TFormChildNode</code> provides a default implementation of these two methods and also of <code>IFormNode::getDocument()</code>.</p>
2449 <h3 id="iformparentnode"><code>IFormParentNode</code><a class="headerlink" href="#iformparentnode" title="Permanent link">#</a></h3>
2450 <p><code>IFormParentNode</code> extends <code>IFormNode</code> for such elements of a form that can be a parent to child nodes.
2451 Additionally, the interface also extends <code>\Countable</code> and <code>\RecursiveIterator</code>.
2452 The interface requires the following methods:</p>
2453 <ul>
2454 <li><code>appendChild(IFormChildNode $child)</code>, <code>appendChildren(array $children)</code>, <code>insertAfter(IFormChildNode $child, $referenceNodeId)</code>, and <code>insertBefore(IFormChildNode $child, $referenceNodeId)</code> are used to insert new children either at the end or at specific positions.
2455 <code>validateChild(IFormChildNode $child)</code> is used to check if a given child node can be added.
2456 A child node cannot be added if it would cause an id to be used twice.</li>
2457 <li><code>children()</code> returns the direct children of a form node.</li>
2458 <li><code>getIterator()</code> return a recursive iterator for a form node.</li>
2459 <li><code>getNodeById($nodeId)</code> returns the node with the given id by searching for it in the node’s children and recursively in all of their children.
2460 <code>contains($nodeId)</code> can be used to simply check if a node with the given id exists.</li>
2461 <li><code>hasValidationErrors()</code> checks if a form node or any of its children has a validation error (see <code>IFormField::getValidationErrors()</code>).</li>
2462 <li><code>readValues()</code> recursively calls <code>IFormParentNode::readValues()</code> and <code>IFormField::readValue()</code> on its children.</li>
2463 </ul>
2464 <h3 id="iformelement"><code>IFormElement</code><a class="headerlink" href="#iformelement" title="Permanent link">#</a></h3>
2465 <p><code>IFormElement</code> extends <code>IFormNode</code> for such elements of a form that can have a description and a label and it requires the following methods:</p>
2466 <ul>
2467 <li><code>label($languageItem = null, array $variables = [])</code> and <code>getLabel()</code> can be used to set and get the label of the form element.
2468 <code>requiresLabel()</code> can be checked if the form element requires a label.
2469 A label-less form element that requires a label will prevent the form from being rendered by throwing an exception.</li>
2470 <li><code>description($languageItem = null, array $variables = [])</code> and <code>getDescription()</code> can be used to set and get the description of the form element.</li>
2471 </ul>
2472 <h3 id="iobjecttypeformnode"><code>IObjectTypeFormNode</code><a class="headerlink" href="#iobjecttypeformnode" title="Permanent link">#</a></h3>
2473 <p><code>IObjectTypeFormField</code> has to be implemented by form nodes that rely on a object type of a specific object type definition in order to function.
2474 The implementing class has to implement the methods <code>objectType($objectType)</code>, <code>getObjectType()</code>, and <code>getObjectTypeDefinition()</code>.
2475 <code>TObjectTypeFormNode</code> provides a default implementation of these three methods.</p>
2476 <h3 id="customformnode"><code>CustomFormNode</code><a class="headerlink" href="#customformnode" title="Permanent link">#</a></h3>
2477 <p><code>CustomFormNode</code> is a form node whose contents can be set directly via <code>content($content)</code>.</p>
2478 <div class="admonition warning">
2479 <p class="admonition-title">This class should generally not be relied on. Instead, <code>TemplateFormNode</code> should be used.</p>
2480 </div>
2481 <h3 id="templateformnode"><code>TemplateFormNode</code><a class="headerlink" href="#templateformnode" title="Permanent link">#</a></h3>
2482 <p><code>TemplateFormNode</code> is a form node whose contents are read from a template.
2483 <code>TemplateFormNode</code> has the following additional methods:</p>
2484 <ul>
2485 <li><code>application($application)</code> and <code>getApplicaton()</code> can be used to set and get the abbreviation of the application the shown template belongs to.
2486 If no template has been set explicitly, <code>getApplicaton()</code> returns <code>wcf</code>.</li>
2487 <li><code>templateName($templateName)</code> and <code>getTemplateName()</code> can be used to set and get the name of the template containing the node contents.
2488 If no template has been set and the node is rendered, an exception will be thrown.</li>
2489 <li><code>variables(array $variables)</code> and <code>getVariables()</code> can be used to set and get additional variables passed to the template.</li>
2490 </ul>
2491 <h2 id="form-document">Form Document<a class="headerlink" href="#form-document" title="Permanent link">#</a></h2>
2492 <p>A form document object represents the form as a whole and has to implement the <code>IFormDocument</code> interface.
2493 WoltLab Suite provides a default implementation with the <code>FormDocument</code> class.
2494 <code>IFormDocument</code> should not be implemented directly but instead <code>FormDocument</code> should be extended to avoid issues if the <code>IFormDocument</code> interface changes in the future.</p>
2495 <p><code>IFormDocument</code> extends <code>IFormParentNode</code> and requires the following additional methods:</p>
2496 <ul>
2497 <li><code>action($action)</code> and <code>getAction()</code> can be used set and get the <code>action</code> attribute of the <code>&lt;form&gt;</code> HTML element.</li>
2498 <li><code>addButton(IFormButton $button)</code> and <code>getButtons()</code> can be used add and get form buttons that are shown at the bottom of the form.
2499 <code>addDefaultButton($addDefaultButton)</code> and <code>hasDefaultButton()</code> can be used to set and check if the form has the default button which is added by default unless specified otherwise.
2500 Each implementing class may define its own default button.
2501 <code>FormDocument</code> has a button with id <code>submitButton</code>, label <code>wcf.global.button.submit</code>, access key <code>s</code>, and CSS class <code>buttonPrimary</code> as its default button. </li>
2502 <li><code>ajax($ajax)</code> and <code>isAjax()</code> can be used to set and check if the form document is requested via an AJAX request or processes data via an AJAX request.
2503 These methods are helpful for form fields that behave differently when providing data via AJAX.</li>
2504 <li><code>build()</code> has to be called once after all nodes have been added to this document to trigger <code>IFormNode::populate()</code>.</li>
2505 <li>
2506 <p><code>formMode($formMode)</code> and <code>getFormMode()</code> sets the form mode.
2507 Possible form modes are:</p>
2508 </li>
2509 <li>
2510 <p><code>IFormDocument::FORM_MODE_CREATE</code> has to be used when the form is used to create a new object.</p>
2511 </li>
2512 <li><code>IFormDocument::FORM_MODE_UPDATE</code> has to be used when the form is used to edit an existing object.</li>
2513 <li><code>getData()</code> returns the array containing the form data and which is passed as the <code>$parameters</code> argument of the constructor of a database object action object.</li>
2514 <li><code>getDataHandler()</code> returns the data handler for this document that is used to process the field data into a parameters array for the constructor of a database object action object.</li>
2515 <li><code>getEnctype()</code> returns the encoding type of the form.
2516 If the form contains a <code>IFileFormField</code>, <code>multipart/form-data</code> is returned, otherwise <code>null</code> is returned.</li>
2517 <li><code>loadValues(array $data, IStorableObject $object)</code> is used when editing an existing object to set the form field values by calling <code>IFormField::loadValue()</code> for all form fields.
2518 Additionally, the form mode is set to <code>IFormDocument::FORM_MODE_UPDATE</code>.</li>
2519 <li><span class="label label-info">5.4+</span> <code>markRequiredFields(bool $markRequiredFields = true): self</code> and <code>marksRequiredFields(): bool</code> can be used to set and check whether fields that are required are marked (with an asterisk in the label) in the output.</li>
2520 <li><code>method($method)</code> and <code>getMethod()</code> can be used to set and get the <code>method</code> attribute of the <code>&lt;form&gt;</code> HTML element.
2521 By default, the method is <code>post</code>.</li>
2522 <li><code>prefix($prefix)</code> and <code>getPrefix()</code> can be used to set and get a global form prefix that is prepended to form elements’ names and ids to avoid conflicts with other forms.
2523 By default, the prefix is an empty string.
2524 If a prefix of <code>foo</code> is set, <code>getPrefix()</code> returns <code>foo_</code> (additional trailing underscore).</li>
2525 <li><code>requestData(array $requestData)</code>, <code>getRequestData($index = null)</code>, and <code>hasRequestData($index = null)</code> can be used to set, get and check for specific request data.
2526 In most cases, the relevant request data is the <code>$_POST</code> array.
2527 In default AJAX requests handled by database object actions, however, the request data generally is in <code>AbstractDatabaseObjectAction::$parameters</code>.
2528 By default, <code>$_POST</code> is the request data.</li>
2529 </ul>
2530 <p>The last aspect is relevant for <code>DialogFormDocument</code> objects.
2531 <code>DialogFormDocument</code> is a specialized class for forms in dialogs that, in contrast to <code>FormDocument</code> do not require an <code>action</code> to be set.
2532 Additionally, <code>DialogFormDocument</code> provides the <code>cancelable($cancelable = true)</code> and <code>isCancelable()</code> methods used to determine if the dialog from can be canceled.
2533 By default, dialog forms are cancelable.</p>
2534 <h2 id="form-button">Form Button<a class="headerlink" href="#form-button" title="Permanent link">#</a></h2>
2535 <p>A form button object represents a button shown at the end of the form that, for example, submits the form.
2536 Every form button has to implement the <code>IFormButton</code> interface that extends <code>IFormChildNode</code> and <code>IFormElement</code>.
2537 <code>IFormButton</code> requires four methods to be implemented:</p>
2538 <ul>
2539 <li><code>accessKey($accessKey)</code> and <code>getAccessKey()</code> can be used to set and get the access key with which the form button can be activated.
2540 By default, form buttons have no access key set.</li>
2541 <li><code>submit($submitButton)</code> and <code>isSubmit()</code> can be used to set and check if the form button is a submit button.
2542 A submit button is an <code>input[type=submit]</code> element.
2543 Otherwise, the button is a <code>button</code> element. </li>
2544 </ul>
2545 <h2 id="form-container">Form Container<a class="headerlink" href="#form-container" title="Permanent link">#</a></h2>
2546 <p>A form container object represents a container for other form containers or form field directly.
2547 Every form container has to implement the <code>IFormContainer</code> interface which requires the following method:</p>
2548 <ul>
2549 <li><code>loadValues(array $data, IStorableObject $object)</code> is called by <code>IFormDocument::loadValuesFromObject()</code> to inform the container that object data is loaded.
2550 This method is <em>not</em> intended to generally call <code>IFormField::loadValues()</code> on its form field children as these methods are already called by <code>IFormDocument::loadValuesFromObject()</code>.
2551 This method is intended for specialized form containers with more complex logic.</li>
2552 </ul>
2553 <p>There are multiple default container implementations:</p>
2554 <ol>
2555 <li><code>FormContainer</code> is the default implementation of <code>IFormContainer</code>.</li>
2556 <li><code>TabMenuFormContainer</code> represents the container of tab menu, while</li>
2557 <li><code>TabFormContainer</code> represents a tab of a tab menu and</li>
2558 <li><code>TabTabMenuFormContainer</code> represents a tab of a tab menu that itself contains a tab menu.</li>
2559 <li>The children of <code>RowFormContainer</code> are shown in a row and should use <code>col-*</code> classes.</li>
2560 <li>The children of <code>RowFormFieldContainer</code> are also shown in a row but does not show the labels and descriptions of the individual form fields.
2561 Instead of the individual labels and descriptions, the container's label and description is shown and both span all of fields.</li>
2562 <li><code>SuffixFormFieldContainer</code> can be used for one form field with a second selection form field used as a suffix.</li>
2563 </ol>
2564 <p>The methods of the interfaces that <code>FormContainer</code> is implementing are well documented, but here is a short overview of the most important methods when setting up a form or extending a form with an event listener:</p>
2565 <ul>
2566 <li><code>appendChild(IFormChildNode $child)</code>, <code>appendChildren(array $children)</code>, and <code>insertBefore(IFormChildNode $child, $referenceNodeId)</code> are used to insert new children into the form container.</li>
2567 <li><code>description($languageItem = null, array $variables = [])</code> and <code>label($languageItem = null, array $variables = [])</code> are used to set the description and the label or title of the form container.</li>
2568 </ul>
2569 <h2 id="form-field">Form Field<a class="headerlink" href="#form-field" title="Permanent link">#</a></h2>
2570 <p>A form field object represents a concrete form field that allows entering data.
2571 Every form field has to implement the <code>IFormField</code> interface which extends <code>IFormChildNode</code> and <code>IFormElement</code>.</p>
2572 <p><code>IFormField</code> requires the following additional methods:</p>
2573 <ul>
2574 <li><code>addValidationError(IFormFieldValidationError $error)</code> and <code>getValidationErrors()</code> can be used to get and set validation errors of the form field (see <a href="../validation_data/#form-validation">form validation</a>).</li>
2575 <li><code>addValidator(IFormFieldValidator $validator)</code>, <code>getValidators()</code>, <code>removeValidator($validatorId)</code>, and <code>hasValidator($validatorId)</code> can be used to get, set, remove, and check for validators for the form field (see <a href="../validation_data/#form-validation">form validation</a>).</li>
2576 <li><code>getFieldHtml()</code> returns the field's HTML output without the surrounding <code>dl</code> structure.</li>
2577 <li><code>objectProperty($objectProperty)</code> and <code>getObjectProperty()</code> can be used to get and set the object property that the field represents.
2578 When setting the object property is set to an empty string, the previously set object property is unset.
2579 If no object property has been set, the field’s (non-prefixed) id is returned.</li>
2580 </ul>
2581 <p>The object property allows having different fields (requiring different ids) that represent the same object property which is handy when available options of the field’s value depend on another field.
2582 Having object property allows to define different fields for each value of the other field and to use form field dependencies to only show the appropriate field.
2583 - <code>readValue()</code> reads the form field value from the request data after the form is submitted.
2584 - <code>required($required = true)</code> and <code>isRequired()</code> can be used to determine if the form field has to be filled out.
2585 By default, form fields do not have to be filled out.
2586 - <code>value($value)</code> and <code>getSaveValue()</code> can be used to get and set the value of the form field to be used outside of the context of forms.
2587 <code>getValue()</code>, in contrast, returns the internal representation of the form field’s value.
2588 In general, the internal representation is only relevant when validating the value in additional validators.
2589 <code>loadValue(array $data, IStorableObject $object)</code> extracts the form field value from the given data array (and additional, non-editable data from the object if the field needs them).</p>
2590 <p><code>AbstractFormField</code> provides default implementations of many of the listed methods above and should be extended instead of implementing <code>IFormField</code> directly.</p>
2591 <p>An overview of the form fields provided by default can be found <a href="../form_fields/">here</a>.</p>
2592 <h3 id="form-field-interfaces-and-traits">Form Field Interfaces and Traits<a class="headerlink" href="#form-field-interfaces-and-traits" title="Permanent link">#</a></h3>
2593 <p>WoltLab Suite Core provides a variety of interfaces and matching traits with default implementations for several common features of form fields:</p>
2594 <h4 id="iattributeformfield"><code>IAttributeFormField</code><a class="headerlink" href="#iattributeformfield" title="Permanent link">#</a></h4>
2595 <div class="admonition info">
2596 <p class="admonition-title">Only available since version 5.4.</p>
2597 </div>
2598 <p><code>IAttributeFormField</code> has to be implemented by form fields for which attributes can be added to the actual form element (in addition to adding attributes to the surrounding element via the attribute-related methods of <code>IFormNode</code>).
2599 The implementing class has to implement the methods <code>fieldAttribute(string $name, string $value = null): self</code> and <code>getFieldAttribute(string $name): self</code>/<code>getFieldAttributes(): array</code>, which are used to add and get the attributes, respectively.
2600 Additionally, <code>hasFieldAttribute(string $name): bool</code> has to implemented to check if a certain attribute is present, <code>removeFieldAttribute(string $name): self</code> to remove an attribute, and <code>static validateFieldAttribute(string $name)</code> to check if the attribute is valid for this specific class.
2601 <code>TAttributeFormField</code> provides a default implementation of these methods and <code>TInputAttributeFormField</code> specializes the trait for <code>input</code>-based form fields.
2602 These two traits also ensure that if a specific interface that handles a specific attribute is implemented, like <code>IAutoCompleteFormField</code> handling <code>autocomplete</code>, this attribute cannot be set with this API.
2603 Instead, the dedicated API provided by the relevant interface has to be used.</p>
2604 <h4 id="iautocompleteformfield"><code>IAutoCompleteFormField</code><a class="headerlink" href="#iautocompleteformfield" title="Permanent link">#</a></h4>
2605 <div class="admonition info">
2606 <p class="admonition-title">Only available since version 5.4.</p>
2607 </div>
2608 <p><code>IAutoCompleteFormField</code> has to be implemented by form fields that support the <a href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofilling-form-controls:-the-autocomplete-attribute"><code>autocomplete</code> attribute</a>.
2609 The implementing class has to implement the methods <code>autoComplete(?string $autoComplete): self</code> and <code>getAutoComplete(): ?string</code>, which are used to set and get the autocomplete value, respectively.
2610 <code>TAutoCompleteFormField</code> provides a default implementation of these two methods and <code>TTextAutoCompleteFormField</code> specializes the trait for text form fields.
2611 When using <code>TAutoCompleteFormField</code>, you have to implement the <code>getValidAutoCompleteTokens(): array</code> method which returns all valid <code>autocomplete</code> tokens.</p>
2612 <h4 id="iautofocusformfield"><code>IAutoFocusFormField</code><a class="headerlink" href="#iautofocusformfield" title="Permanent link">#</a></h4>
2613 <p><code>IAutoFocusFormField</code> has to be implemented by form fields that can be auto-focused.
2614 The implementing class has to implement the methods <code>autoFocus($autoFocus = true)</code> and <code>isAutoFocused()</code>.
2615 By default, form fields are not auto-focused.
2616 <code>TAutoFocusFormField</code> provides a default implementation of these two methods.</p>
2617 <h4 id="icssclassformfield"><code>ICssClassFormField</code><a class="headerlink" href="#icssclassformfield" title="Permanent link">#</a></h4>
2618 <div class="admonition info">
2619 <p class="admonition-title">Only available since version 5.4.</p>
2620 </div>
2621 <p><code>ICssClassFormField</code> has to be implemented by form fields for which CSS classes can be added to the actual form element (in addition to adding CSS classes to the surrounding element via the class-related methods of <code>IFormNode</code>).
2622 The implementing class has to implement the methods <code>addFieldClass(string $class): self</code>/<code>addFieldClasses(array $classes): self</code> and <code>getFieldClasses(): array</code>, which are used to add and get the CSS classes, respectively.
2623 Additionally, <code>hasFieldClass(string $class): bool</code> has to implemented to check if a certain CSS class is present and <code>removeFieldClass(string $class): self</code> to remove a CSS class.
2624 <code>TCssClassFormField</code> provides a default implementation of these methods.</p>
2625 <h4 id="ifileformfield"><code>IFileFormField</code><a class="headerlink" href="#ifileformfield" title="Permanent link">#</a></h4>
2626 <p><code>IFileFormField</code> has to be implemented by every form field that uploads files so that the <code>enctype</code> attribute of the form document is <code>multipart/form-data</code> (see <code>IFormDocument::getEnctype()</code>).</p>
2627 <h4 id="ifilterableselectionformfield"><code>IFilterableSelectionFormField</code><a class="headerlink" href="#ifilterableselectionformfield" title="Permanent link">#</a></h4>
2628 <p><code>IFilterableSelectionFormField</code> extends <code>ISelectionFormField</code> by the possibilty for users when selecting the value(s) to filter the list of available options.
2629 The implementing class has to implement the methods <code>filterable($filterable = true)</code> and <code>isFilterable()</code>.
2630 <code>TFilterableSelectionFormField</code> provides a default implementation of these two methods.</p>
2631 <h4 id="ii18nformfield"><code>II18nFormField</code><a class="headerlink" href="#ii18nformfield" title="Permanent link">#</a></h4>
2632 <p><code>II18nFormField</code> has to be implemented by form fields if the form field value can be entered separately for all available languages.
2633 The implementing class has to implement the following methods:</p>
2634 <ul>
2635 <li><code>i18n($i18n = true)</code> and <code>isI18n()</code> can be used to set whether a specific instance of the class actually supports multilingual input.</li>
2636 <li><code>i18nRequired($i18nRequired = true)</code> and <code>isI18nRequired()</code> can be used to set whether a specific instance of the class requires separate values for all languages.</li>
2637 <li><code>languageItemPattern($pattern)</code> and <code>getLanguageItemPattern()</code> can be used to set the pattern/regular expression for the language item used to save the multilingual values.</li>
2638 <li><code>hasI18nValues()</code> and <code>hasPlainValue()</code> check if the current value is a multilingual or monolingual value.</li>
2639 </ul>
2640 <p><code>TI18nFormField</code> provides a default implementation of these eight methods and additional default implementations of some of the <code>IFormField</code> methods.
2641 If multilingual input is enabled for a specific form field, classes using <code>TI18nFormField</code> register a <a href="../validation_data/#customformfielddataprocessor">custom form field data processor</a> to add the array with multilingual input into the <code>$parameters</code> array directly using <code>{$objectProperty}_i18n</code> as the array key.
2642 If multilingual input is enabled but only a monolingual value is entered, the custom form field data processor does nothing and the form field’s value is added by the <code>DefaultFormDataProcessor</code> into the <code>data</code> sub-array of the <code>$parameters</code> array.</p>
2643 <div class="admonition info">
2644 <p class="admonition-title"><code>TI18nFormField</code> already provides a default implementation of <code>IFormField::validate()</code>.</p>
2645 </div>
2646 <h4 id="iimmutableformfield"><code>IImmutableFormField</code><a class="headerlink" href="#iimmutableformfield" title="Permanent link">#</a></h4>
2647 <p><code>IImmutableFormField</code> has to be implemented by form fields that support being displayed but whose value cannot be changed.
2648 The implementing class has to implement the methods <code>immutable($immutable = true)</code> and <code>isImmutable()</code> that can be used to determine if the value of the form field is mutable or immutable.
2649 By default, form field are mutable.</p>
2650 <h4 id="iinputmodeformfield"><code>IInputModeFormField</code><a class="headerlink" href="#iinputmodeformfield" title="Permanent link">#</a></h4>
2651 <div class="admonition info">
2652 <p class="admonition-title">Only available since version 5.4.</p>
2653 </div>
2654 <p><code>IInputModeFormField</code> has to be implemented by form fields that support the <a href="https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute"><code>inputmode</code> attribute</a>.
2655 The implementing class has to implement the methods <code>inputMode(?string $inputMode): self</code> and <code>getInputMode(): ?string</code>, which are used to set and get the input mode, respectively.
2656 <code>TInputModeFormField</code> provides a default implementation of these two methods.</p>
2657 <h4 id="imaximumformfield"><code>IMaximumFormField</code><a class="headerlink" href="#imaximumformfield" title="Permanent link">#</a></h4>
2658 <p><code>IMaximumFormField</code> has to be implemented by form fields if the entered value must have a maximum value.
2659 The implementing class has to implement the methods <code>maximum($maximum = null)</code> and <code>getMaximum()</code>.
2660 A maximum of <code>null</code> signals that no maximum value has been set.
2661 <code>TMaximumFormField</code> provides a default implementation of these two methods.</p>
2662 <div class="admonition warning">
2663 <p class="admonition-title">The implementing class has to validate the entered value against the maximum value manually.</p>
2664 </div>
2665 <h4 id="imaximumlengthformfield"><code>IMaximumLengthFormField</code><a class="headerlink" href="#imaximumlengthformfield" title="Permanent link">#</a></h4>
2666 <p><code>IMaximumLengthFormField</code> has to be implemented by form fields if the entered value must have a maximum length.
2667 The implementing class has to implement the methods <code>maximumLength($maximumLength = null)</code>, <code>getMaximumLength()</code>, and <code>validateMaximumLength($text, Language $language = null)</code>.
2668 A maximum length of <code>null</code> signals that no maximum length has been set.
2669 <code>TMaximumLengthFormField</code> provides a default implementation of these two methods.</p>
2670 <div class="admonition warning">
2671 <p class="admonition-title">The implementing class has to validate the entered value against the maximum value manually by calling <code>validateMaximumLength()</code>.</p>
2672 </div>
2673 <h4 id="iminimumformfield"><code>IMinimumFormField</code><a class="headerlink" href="#iminimumformfield" title="Permanent link">#</a></h4>
2674 <p><code>IMinimumFormField</code> has to be implemented by form fields if the entered value must have a minimum value.
2675 The implementing class has to implement the methods <code>minimum($minimum = null)</code> and <code>getMinimum()</code>.
2676 A minimum of <code>null</code> signals that no minimum value has been set.
2677 <code>TMinimumFormField</code> provides a default implementation of these three methods.</p>
2678 <div class="admonition warning">
2679 <p class="admonition-title">The implementing class has to validate the entered value against the minimum value manually.</p>
2680 </div>
2681 <h4 id="iminimumlengthformfield"><code>IMinimumLengthFormField</code><a class="headerlink" href="#iminimumlengthformfield" title="Permanent link">#</a></h4>
2682 <p><code>IMinimumLengthFormField</code> has to be implemented by form fields if the entered value must have a minimum length.
2683 The implementing class has to implement the methods <code>minimumLength($minimumLength = null)</code>, <code>getMinimumLength()</code>, and <code>validateMinimumLength($text, Language $language = null)</code>.
2684 A minimum length of <code>null</code> signals that no minimum length has been set.
2685 <code>TMinimumLengthFormField</code> provides a default implementation of these three methods.</p>
2686 <div class="admonition warning">
2687 <p class="admonition-title">The implementing class has to validate the entered value against the minimum value manually by calling <code>validateMinimumLength()</code>.</p>
2688 </div>
2689 <h4 id="imultipleformfield"><code>IMultipleFormField</code><a class="headerlink" href="#imultipleformfield" title="Permanent link">#</a></h4>
2690 <p><code>IMinimumLengthFormField</code> has to be implemented by form fields that support selecting or setting multiple values.
2691 The implementing class has to implement the following methods:</p>
2692 <ul>
2693 <li><code>multiple($multiple = true)</code> and <code>allowsMultiple()</code> can be used to set whether a specific instance of the class actually should support multiple values.
2694 By default, multiple values are not supported.</li>
2695 <li><code>minimumMultiples($minimum)</code> and <code>getMinimumMultiples()</code> can be used to set the minimum number of values that have to be selected/entered.
2696 By default, there is no required minimum number of values.</li>
2697 <li><code>maximumMultiples($minimum)</code> and <code>getMaximumMultiples()</code> can be used to set the maximum number of values that have to be selected/entered.
2698 By default, there is no maximum number of values.
2699 <code>IMultipleFormField::NO_MAXIMUM_MULTIPLES</code> is returned if no maximum number of values has been set and it can also be used to unset a previously set maximum number of values.</li>
2700 </ul>
2701 <p><code>TMultipleFormField</code> provides a default implementation of these six methods and classes using <code>TMultipleFormField</code> register a <a href="../validation_data/#customformfielddataprocessor">custom form field data processor</a> to add the <code>HtmlInputProcessor</code> object with the text into the <code>$parameters</code> array directly using <code>{$objectProperty}_htmlInputProcessor</code> as the array key.</p>
2702 <div class="admonition warning">
2703 <p class="admonition-title">The implementing class has to validate the values against the minimum and maximum number of values manually.</p>
2704 </div>
2705 <h4 id="inullableformfield"><code>INullableFormField</code><a class="headerlink" href="#inullableformfield" title="Permanent link">#</a></h4>
2706 <p><code>INullableFormField</code> has to be implemented by form fields that support <code>null</code> as their (empty) value.
2707 The implementing class has to implement the methods <code>nullable($nullable = true)</code> and <code>isNullable()</code>.
2708 <code>TNullableFormField</code> provides a default implementation of these two methods.</p>
2709 <p><code>null</code> should be returned by <code>IFormField::getSaveValue()</code> is the field is considered empty and the form field has been set as nullable.</p>
2710 <h4 id="ipackagesformfield"><code>IPackagesFormField</code><a class="headerlink" href="#ipackagesformfield" title="Permanent link">#</a></h4>
2711 <p><code>IPackagesFormField</code> has to be implemented by form fields that, in some way, considers packages whose ids may be passed to the field object.
2712 The implementing class has to implement the methods <code>packageIDs(array $packageIDs)</code> and <code>getPackageIDs()</code>.
2713 <code>TPackagesFormField</code> provides a default implementation of these two methods.</p>
2714 <h4 id="ipatternformfield"><code>IPatternFormField</code><a class="headerlink" href="#ipatternformfield" title="Permanent link">#</a></h4>
2715 <div class="admonition info">
2716 <p class="admonition-title">Only available since version 5.4.</p>
2717 </div>
2718 <p><code>IPatternFormField</code> has to be implemented by form fields that support the <a href="https://html.spec.whatwg.org/multipage/input.html#the-pattern-attribute"><code>pattern</code> attribute</a>.
2719 The implementing class has to implement the methods <code>pattern(?string $pattern): self</code> and <code>getPattern(): ?string</code>, which are used to set and get the pattern, respectively.
2720 <code>TPatternFormField</code> provides a default implementation of these two methods.</p>
2721 <h4 id="iplaceholderformfield"><code>IPlaceholderFormField</code><a class="headerlink" href="#iplaceholderformfield" title="Permanent link">#</a></h4>
2722 <p><code>IPlaceholderFormField</code> has to be implemented by form fields that support a placeholder value for empty fields.
2723 The implementing class has to implement the methods <code>placeholder($languageItem = null, array $variables = [])</code> and <code>getPlaceholder()</code>.
2724 <code>TPlaceholderFormField</code> provides a default implementation of these two methods.</p>
2725 <h4 id="iselectionformfield"><code>ISelectionFormField</code><a class="headerlink" href="#iselectionformfield" title="Permanent link">#</a></h4>
2726 <p><code>ISelectionFormField</code> has to be implemented by form fields with a predefined set of possible values.
2727 The implementing class has to implement the getter and setter methods <code>options($options, $nestedOptions = false, $labelLanguageItems = true)</code> and <code>getOptions()</code> and additionally two methods related to nesting, i.e. whether the selectable options have a hierarchy:
2728 <code>supportsNestedOptions()</code> and <code>getNestedOptions()</code>.
2729 <code>TSelectionFormField</code> provides a default implementation of these four methods.</p>
2730 <h4 id="isuffixedformfield"><code>ISuffixedFormField</code><a class="headerlink" href="#isuffixedformfield" title="Permanent link">#</a></h4>
2731 <p><code>ISuffixedFormField</code> has to be implemented by form fields that support supports displaying a suffix behind the actual input field.
2732 The implementing class has to implement the methods <code>suffix($languageItem = null, array $variables = [])</code> and <code>getSuffix()</code>.
2733 <code>TSuffixedFormField</code> provides a default implementation of these two methods.</p>
2734 <h4 id="tdefaultidformfield"><code>TDefaultIdFormField</code><a class="headerlink" href="#tdefaultidformfield" title="Permanent link">#</a></h4>
2735 <p>Form fields that have a default id have to use <code>TDefaultIdFormField</code> and have to implement the method <code>getDefaultId()</code>.</p>
2736 <h2 id="displaying-forms">Displaying Forms<a class="headerlink" href="#displaying-forms" title="Permanent link">#</a></h2>
2737 <p>The only thing to do in a template to display the <strong>whole</strong> form including all of the necessary JavaScript is to put</p>
2738 <div class="highlight"><pre><span></span><code><span class="cp">{</span><span class="o">@</span><span class="nv">$form</span><span class="o">-&gt;</span><span class="na">getHtml</span><span class="o">()</span><span class="cp">}</span><span class="x"></span>
2739 </code></pre></div>
2740 <p>into the template file at the relevant position.</p>
2741
2742
2743
2744
2745 <hr>
2746 <div class="md-source-date">
2747 <small>
2748
2749 Last update: 2021-01-16
2750
2751 </small>
2752 </div>
2753
2754
2755
2756
2757
2758
2759
2760
2761 </article>
2762 </div>
2763 </div>
2764
2765 </main>
2766
2767
2768 <footer class="md-footer">
2769
2770 <nav class="md-footer__inner md-grid" aria-label="Footer">
2771
2772 <a href="../overview/" class="md-footer__link md-footer__link--prev" rel="prev">
2773 <div class="md-footer__button md-icon">
2774 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
2775 </div>
2776 <div class="md-footer__title">
2777 <div class="md-ellipsis">
2778 <span class="md-footer__direction">
2779 Previous
2780 </span>
2781 Overview
2782 </div>
2783 </div>
2784 </a>
2785
2786
2787 <a href="../form_fields/" class="md-footer__link md-footer__link--next" rel="next">
2788 <div class="md-footer__title">
2789 <div class="md-ellipsis">
2790 <span class="md-footer__direction">
2791 Next
2792 </span>
2793 Fields
2794 </div>
2795 </div>
2796 <div class="md-footer__button md-icon">
2797 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
2798 </div>
2799 </a>
2800
2801 </nav>
2802
2803 <div class="md-footer-meta md-typeset">
2804 <div class="md-footer-meta__inner md-grid">
2805 <div class="md-footer-copyright">
2806
2807 <div class="md-footer-copyright__highlight">
2808 Copyright © 2020 WoltLab GmbH
2809 </div>
2810
2811 Made with
2812 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
2813 Material for MkDocs
2814 </a>
2815
2816 </div>
2817 <div class="md-footer-copyright">
2818 <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a>
2819 <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a>
2820 </div>
2821 </div>
2822 </div>
2823 </footer>
2824
2825 </div>
2826 <div class="md-dialog" data-md-component="dialog">
2827 <div class="md-dialog__inner md-typeset"></div>
2828 </div>
2829 <script id="__config" type="application/json">{"base": "../../../..", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing"}, "search": "../../../../assets/javascripts/workers/search.fe42c31b.min.js", "version": {"provider": "mike"}}</script>
2830
2831
2832 <script src="../../../../assets/javascripts/bundle.d892486b.min.js"></script>
2833
2834
2835 </body>
2836 </html>