3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
12 <link rel=
"icon" href=
"../../../../assets/default.favicon.ico">
13 <meta name=
"generator" content=
"mkdocs-1.1.2, mkdocs-material-7.1.0">
17 <title>Overview - WoltLab Suite Documentation
</title>
21 <link rel=
"stylesheet" href=
"../../../../assets/stylesheets/main.33e2939f.min.css">
24 <link rel=
"stylesheet" href=
"../../../../assets/stylesheets/palette.ef6f36e2.min.css">
28 <meta name=
"theme-color" content=
"#009485">
38 <link rel=
"stylesheet" href=
"../../../../stylesheets/extra.css">
52 <body dir=
"ltr" data-md-color-scheme=
"" data-md-color-primary=
"teal" data-md-color-accent=
"">
55 <script>function __prefix(e){return new URL(
"../../../..",location).pathname+
"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}
</script>
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">
63 <a href=
"#form-builder" class=
"md-skip">
68 <div data-md-component=
"announce">
70 <aside class=
"md-announce">
71 <div class=
"md-announce__inner md-grid md-typeset">
73 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
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">
84 <img src=
"../../../../assets/logo.png" alt=
"logo">
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>
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
97 <div class=
"md-header__topic" data-md-component=
"header-topic">
98 <span class=
"md-ellipsis">
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>
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>
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>
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">
132 <ol class=
"md-search-result__list"></ol>
140 <div class=
"md-header__source">
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">
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>
147 <div class=
"md-source__repository">
156 <div class=
"md-container" data-md-component=
"container">
161 <main class=
"md-main" data-md-component=
"main">
162 <div class=
"md-main__inner md-grid">
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">
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">
176 <img src=
"../../../../assets/logo.png" alt=
"logo">
179 WoltLab Suite Documentation
182 <div class=
"md-nav__source">
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">
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>
189 <div class=
"md-source__repository">
195 <ul class=
"md-nav__list" data-md-scrollfix
>
204 <li class=
"md-nav__item">
205 <a href=
"../../../../getting-started/" class=
"md-nav__link">
222 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
225 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2" type=
"checkbox" id=
"__nav_2" checked
>
227 <label class=
"md-nav__link" for=
"__nav_2">
229 <span class=
"md-nav__icon md-icon"></span>
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>
236 <ul class=
"md-nav__list" data-md-scrollfix
>
242 <li class=
"md-nav__item">
243 <a href=
"../../../pages/" class=
"md-nav__link">
254 <li class=
"md-nav__item">
255 <a href=
"../../../database-objects/" class=
"md-nav__link">
266 <li class=
"md-nav__item">
267 <a href=
"../../../database-access/" class=
"md-nav__link">
278 <li class=
"md-nav__item">
279 <a href=
"../../../exceptions/" class=
"md-nav__link">
293 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
296 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5" type=
"checkbox" id=
"__nav_2_5" checked
>
298 <label class=
"md-nav__link" for=
"__nav_2_5">
300 <span class=
"md-nav__icon md-icon"></span>
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>
307 <ul class=
"md-nav__list" data-md-scrollfix
>
314 <li class=
"md-nav__item md-nav__item--nested">
317 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_1" type=
"checkbox" id=
"__nav_2_5_1" >
319 <label class=
"md-nav__link" for=
"__nav_2_5_1">
321 <span class=
"md-nav__icon md-icon"></span>
323 <nav class=
"md-nav" aria-label=
"Caches" data-md-level=
"3">
324 <label class=
"md-nav__title" for=
"__nav_2_5_1">
325 <span class=
"md-nav__icon md-icon"></span>
328 <ul class=
"md-nav__list" data-md-scrollfix
>
334 <li class=
"md-nav__item">
335 <a href=
"../../caches/" class=
"md-nav__link">
346 <li class=
"md-nav__item">
347 <a href=
"../../caches_persistent-caches/" class=
"md-nav__link">
358 <li class=
"md-nav__item">
359 <a href=
"../../caches_runtime-caches/" class=
"md-nav__link">
376 <li class=
"md-nav__item">
377 <a href=
"../../comments/" class=
"md-nav__link">
388 <li class=
"md-nav__item">
389 <a href=
"../../cronjobs/" class=
"md-nav__link">
400 <li class=
"md-nav__item">
401 <a href=
"../../events/" class=
"md-nav__link">
415 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
418 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_5" type=
"checkbox" id=
"__nav_2_5_5" checked
>
420 <label class=
"md-nav__link" for=
"__nav_2_5_5">
422 <span class=
"md-nav__icon md-icon"></span>
424 <nav class=
"md-nav" aria-label=
"Form Builder" data-md-level=
"3">
425 <label class=
"md-nav__title" for=
"__nav_2_5_5">
426 <span class=
"md-nav__icon md-icon"></span>
429 <ul class=
"md-nav__list" data-md-scrollfix
>
437 <li class=
"md-nav__item md-nav__item--active">
439 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"toc" type=
"checkbox" id=
"__toc">
444 <label class=
"md-nav__link md-nav__link--active" for=
"__toc">
446 <span class=
"md-nav__icon md-icon"></span>
449 <a href=
"./" class=
"md-nav__link md-nav__link--active">
454 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
460 <label class=
"md-nav__title" for=
"__toc">
461 <span class=
"md-nav__icon md-icon"></span>
464 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
466 <li class=
"md-nav__item">
467 <a href=
"#advantages-of-form-builder" class=
"md-nav__link">
468 Advantages of Form Builder
473 <li class=
"md-nav__item">
474 <a href=
"#form-builder-components" class=
"md-nav__link">
475 Form Builder Components
480 <li class=
"md-nav__item">
481 <a href=
"#abstractformbuilderform" class=
"md-nav__link">
482 AbstractFormBuilderForm
487 <li class=
"md-nav__item">
488 <a href=
"#dialogformdocument" class=
"md-nav__link">
506 <li class=
"md-nav__item">
507 <a href=
"../structure/" class=
"md-nav__link">
518 <li class=
"md-nav__item">
519 <a href=
"../form_fields/" class=
"md-nav__link">
530 <li class=
"md-nav__item">
531 <a href=
"../validation_data/" class=
"md-nav__link">
542 <li class=
"md-nav__item">
543 <a href=
"../dependencies/" class=
"md-nav__link">
560 <li class=
"md-nav__item">
561 <a href=
"../../package_installation_plugins/" class=
"md-nav__link">
562 Package Installation Plugins
572 <li class=
"md-nav__item">
573 <a href=
"../../user_activity_points/" class=
"md-nav__link">
584 <li class=
"md-nav__item">
585 <a href=
"../../user_notifications/" class=
"md-nav__link">
596 <li class=
"md-nav__item">
597 <a href=
"../../sitemaps/" class=
"md-nav__link">
614 <li class=
"md-nav__item">
615 <a href=
"../../../code-style/" class=
"md-nav__link">
626 <li class=
"md-nav__item">
627 <a href=
"../../../apps/" class=
"md-nav__link">
638 <li class=
"md-nav__item">
639 <a href=
"../../../gdpr/" class=
"md-nav__link">
660 <li class=
"md-nav__item md-nav__item--nested">
663 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_3" type=
"checkbox" id=
"__nav_3" >
665 <label class=
"md-nav__link" for=
"__nav_3">
666 Languages, Templates & CSS
667 <span class=
"md-nav__icon md-icon"></span>
669 <nav class=
"md-nav" aria-label=
"Languages, Templates & CSS" data-md-level=
"1">
670 <label class=
"md-nav__title" for=
"__nav_3">
671 <span class=
"md-nav__icon md-icon"></span>
672 Languages, Templates & CSS
674 <ul class=
"md-nav__list" data-md-scrollfix
>
680 <li class=
"md-nav__item">
681 <a href=
"../../../../view/languages/" class=
"md-nav__link">
692 <li class=
"md-nav__item">
693 <a href=
"../../../../view/templates/" class=
"md-nav__link">
704 <li class=
"md-nav__item">
705 <a href=
"../../../../view/template-plugins/" class=
"md-nav__link">
716 <li class=
"md-nav__item">
717 <a href=
"../../../../view/css/" class=
"md-nav__link">
738 <li class=
"md-nav__item md-nav__item--nested">
741 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4" type=
"checkbox" id=
"__nav_4" >
743 <label class=
"md-nav__link" for=
"__nav_4">
744 TypeScript and JavaScript API
745 <span class=
"md-nav__icon md-icon"></span>
747 <nav class=
"md-nav" aria-label=
"TypeScript and JavaScript API" data-md-level=
"1">
748 <label class=
"md-nav__title" for=
"__nav_4">
749 <span class=
"md-nav__icon md-icon"></span>
750 TypeScript and JavaScript API
752 <ul class=
"md-nav__list" data-md-scrollfix
>
758 <li class=
"md-nav__item">
759 <a href=
"../../../../javascript/general-usage/" class=
"md-nav__link">
770 <li class=
"md-nav__item">
771 <a href=
"../../../../javascript/typescript/" class=
"md-nav__link">
783 <li class=
"md-nav__item md-nav__item--nested">
786 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4_3" type=
"checkbox" id=
"__nav_4_3" >
788 <label class=
"md-nav__link" for=
"__nav_4_3">
790 <span class=
"md-nav__icon md-icon"></span>
792 <nav class=
"md-nav" aria-label=
"New API" data-md-level=
"2">
793 <label class=
"md-nav__title" for=
"__nav_4_3">
794 <span class=
"md-nav__icon md-icon"></span>
797 <ul class=
"md-nav__list" data-md-scrollfix
>
803 <li class=
"md-nav__item">
804 <a href=
"../../../../javascript/new-api_writing-a-module/" class=
"md-nav__link">
815 <li class=
"md-nav__item">
816 <a href=
"../../../../javascript/new-api_data-structures/" class=
"md-nav__link">
827 <li class=
"md-nav__item">
828 <a href=
"../../../../javascript/new-api_core/" class=
"md-nav__link">
839 <li class=
"md-nav__item">
840 <a href=
"../../../../javascript/new-api_dom/" class=
"md-nav__link">
851 <li class=
"md-nav__item">
852 <a href=
"../../../../javascript/new-api_events/" class=
"md-nav__link">
863 <li class=
"md-nav__item">
864 <a href=
"../../../../javascript/new-api_ajax/" class=
"md-nav__link">
875 <li class=
"md-nav__item">
876 <a href=
"../../../../javascript/new-api_dialogs/" class=
"md-nav__link">
887 <li class=
"md-nav__item">
888 <a href=
"../../../../javascript/new-api_browser/" class=
"md-nav__link">
889 Browser and Screen Sizes
899 <li class=
"md-nav__item">
900 <a href=
"../../../../javascript/new-api_ui/" class=
"md-nav__link">
917 <li class=
"md-nav__item">
918 <a href=
"../../../../javascript/legacy-api/" class=
"md-nav__link">
929 <li class=
"md-nav__item">
930 <a href=
"../../../../javascript/helper-functions/" class=
"md-nav__link">
941 <li class=
"md-nav__item">
942 <a href=
"../../../../javascript/code-snippets/" class=
"md-nav__link">
963 <li class=
"md-nav__item md-nav__item--nested">
966 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5" type=
"checkbox" id=
"__nav_5" >
968 <label class=
"md-nav__link" for=
"__nav_5">
970 <span class=
"md-nav__icon md-icon"></span>
972 <nav class=
"md-nav" aria-label=
"Package Components" data-md-level=
"1">
973 <label class=
"md-nav__title" for=
"__nav_5">
974 <span class=
"md-nav__icon md-icon"></span>
977 <ul class=
"md-nav__list" data-md-scrollfix
>
983 <li class=
"md-nav__item">
984 <a href=
"../../../../package/package-xml/" class=
"md-nav__link">
996 <li class=
"md-nav__item md-nav__item--nested">
999 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5_2" type=
"checkbox" id=
"__nav_5_2" >
1001 <label class=
"md-nav__link" for=
"__nav_5_2">
1003 <span class=
"md-nav__icon md-icon"></span>
1005 <nav class=
"md-nav" aria-label=
"PIPs" data-md-level=
"2">
1006 <label class=
"md-nav__title" for=
"__nav_5_2">
1007 <span class=
"md-nav__icon md-icon"></span>
1010 <ul class=
"md-nav__list" data-md-scrollfix
>
1016 <li class=
"md-nav__item">
1017 <a href=
"../../../../package/pip/" class=
"md-nav__link">
1028 <li class=
"md-nav__item">
1029 <a href=
"../../../../package/pip/acl-option/" class=
"md-nav__link">
1040 <li class=
"md-nav__item">
1041 <a href=
"../../../../package/pip/acp-menu/" class=
"md-nav__link">
1052 <li class=
"md-nav__item">
1053 <a href=
"../../../../package/pip/acp-search-provider/" class=
"md-nav__link">
1064 <li class=
"md-nav__item">
1065 <a href=
"../../../../package/pip/acp-template/" class=
"md-nav__link">
1076 <li class=
"md-nav__item">
1077 <a href=
"../../../../package/pip/bbcode/" class=
"md-nav__link">
1088 <li class=
"md-nav__item">
1089 <a href=
"../../../../package/pip/box/" class=
"md-nav__link">
1100 <li class=
"md-nav__item">
1101 <a href=
"../../../../package/pip/clipboard-action/" class=
"md-nav__link">
1112 <li class=
"md-nav__item">
1113 <a href=
"../../../../package/pip/core-object/" class=
"md-nav__link">
1124 <li class=
"md-nav__item">
1125 <a href=
"../../../../package/pip/cronjob/" class=
"md-nav__link">
1136 <li class=
"md-nav__item">
1137 <a href=
"../../../../package/pip/database/" class=
"md-nav__link">
1148 <li class=
"md-nav__item">
1149 <a href=
"../../../../package/pip/event-listener/" class=
"md-nav__link">
1160 <li class=
"md-nav__item">
1161 <a href=
"../../../../package/pip/file/" class=
"md-nav__link">
1172 <li class=
"md-nav__item">
1173 <a href=
"../../../../package/pip/language/" class=
"md-nav__link">
1184 <li class=
"md-nav__item">
1185 <a href=
"../../../../package/pip/media-provider/" class=
"md-nav__link">
1196 <li class=
"md-nav__item">
1197 <a href=
"../../../../package/pip/menu/" class=
"md-nav__link">
1208 <li class=
"md-nav__item">
1209 <a href=
"../../../../package/pip/menu-item/" class=
"md-nav__link">
1220 <li class=
"md-nav__item">
1221 <a href=
"../../../../package/pip/object-type/" class=
"md-nav__link">
1232 <li class=
"md-nav__item">
1233 <a href=
"../../../../package/pip/object-type-definition/" class=
"md-nav__link">
1234 objectTypeDefinition
1244 <li class=
"md-nav__item">
1245 <a href=
"../../../../package/pip/option/" class=
"md-nav__link">
1256 <li class=
"md-nav__item">
1257 <a href=
"../../../../package/pip/page/" class=
"md-nav__link">
1268 <li class=
"md-nav__item">
1269 <a href=
"../../../../package/pip/pip/" class=
"md-nav__link">
1280 <li class=
"md-nav__item">
1281 <a href=
"../../../../package/pip/script/" class=
"md-nav__link">
1292 <li class=
"md-nav__item">
1293 <a href=
"../../../../package/pip/smiley/" class=
"md-nav__link">
1304 <li class=
"md-nav__item">
1305 <a href=
"../../../../package/pip/sql/" class=
"md-nav__link">
1316 <li class=
"md-nav__item">
1317 <a href=
"../../../../package/pip/style/" class=
"md-nav__link">
1328 <li class=
"md-nav__item">
1329 <a href=
"../../../../package/pip/template/" class=
"md-nav__link">
1340 <li class=
"md-nav__item">
1341 <a href=
"../../../../package/pip/template-listener/" class=
"md-nav__link">
1352 <li class=
"md-nav__item">
1353 <a href=
"../../../../package/pip/user-group-option/" class=
"md-nav__link">
1364 <li class=
"md-nav__item">
1365 <a href=
"../../../../package/pip/user-menu/" class=
"md-nav__link">
1376 <li class=
"md-nav__item">
1377 <a href=
"../../../../package/pip/user-notification-event/" class=
"md-nav__link">
1378 userNotificationEvent
1388 <li class=
"md-nav__item">
1389 <a href=
"../../../../package/pip/user-option/" class=
"md-nav__link">
1400 <li class=
"md-nav__item">
1401 <a href=
"../../../../package/pip/user-profile-menu/" class=
"md-nav__link">
1418 <li class=
"md-nav__item">
1419 <a href=
"../../../../package/database-php-api/" class=
"md-nav__link">
1440 <li class=
"md-nav__item md-nav__item--nested">
1443 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6" type=
"checkbox" id=
"__nav_6" >
1445 <label class=
"md-nav__link" for=
"__nav_6">
1447 <span class=
"md-nav__icon md-icon"></span>
1449 <nav class=
"md-nav" aria-label=
"Migration" data-md-level=
"1">
1450 <label class=
"md-nav__title" for=
"__nav_6">
1451 <span class=
"md-nav__icon md-icon"></span>
1454 <ul class=
"md-nav__list" data-md-scrollfix
>
1461 <li class=
"md-nav__item md-nav__item--nested">
1464 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_1" type=
"checkbox" id=
"__nav_6_1" >
1466 <label class=
"md-nav__link" for=
"__nav_6_1">
1467 Migrating from WSC
5.3
1468 <span class=
"md-nav__icon md-icon"></span>
1470 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.3" data-md-level=
"2">
1471 <label class=
"md-nav__title" for=
"__nav_6_1">
1472 <span class=
"md-nav__icon md-icon"></span>
1473 Migrating from WSC
5.3
1475 <ul class=
"md-nav__list" data-md-scrollfix
>
1481 <li class=
"md-nav__item">
1482 <a href=
"../../../../migration/wsc53/php/" class=
"md-nav__link">
1493 <li class=
"md-nav__item">
1494 <a href=
"../../../../migration/wsc53/session/" class=
"md-nav__link">
1495 Session Handling and Authentication
1505 <li class=
"md-nav__item">
1506 <a href=
"../../../../migration/wsc53/javascript/" class=
"md-nav__link">
1507 TypeScript and JavaScript
1517 <li class=
"md-nav__item">
1518 <a href=
"../../../../migration/wsc53/templates/" class=
"md-nav__link">
1529 <li class=
"md-nav__item">
1530 <a href=
"../../../../migration/wsc53/libraries/" class=
"md-nav__link">
1531 Third Party Libraries
1548 <li class=
"md-nav__item md-nav__item--nested">
1551 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_2" type=
"checkbox" id=
"__nav_6_2" >
1553 <label class=
"md-nav__link" for=
"__nav_6_2">
1554 Migrating from WSC
5.2
1555 <span class=
"md-nav__icon md-icon"></span>
1557 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.2" data-md-level=
"2">
1558 <label class=
"md-nav__title" for=
"__nav_6_2">
1559 <span class=
"md-nav__icon md-icon"></span>
1560 Migrating from WSC
5.2
1562 <ul class=
"md-nav__list" data-md-scrollfix
>
1568 <li class=
"md-nav__item">
1569 <a href=
"../../../../migration/wsc52/php/" class=
"md-nav__link">
1580 <li class=
"md-nav__item">
1581 <a href=
"../../../../migration/wsc52/templates/" class=
"md-nav__link">
1582 Templates and Languages
1592 <li class=
"md-nav__item">
1593 <a href=
"../../../../migration/wsc52/libraries/" class=
"md-nav__link">
1594 Third Party Libraries
1611 <li class=
"md-nav__item md-nav__item--nested">
1614 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_3" type=
"checkbox" id=
"__nav_6_3" >
1616 <label class=
"md-nav__link" for=
"__nav_6_3">
1617 Migrating from WSC
3.1
1618 <span class=
"md-nav__icon md-icon"></span>
1620 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.1" data-md-level=
"2">
1621 <label class=
"md-nav__title" for=
"__nav_6_3">
1622 <span class=
"md-nav__icon md-icon"></span>
1623 Migrating from WSC
3.1
1625 <ul class=
"md-nav__list" data-md-scrollfix
>
1631 <li class=
"md-nav__item">
1632 <a href=
"../../../../migration/wsc31/php/" class=
"md-nav__link">
1650 <li class=
"md-nav__item md-nav__item--nested">
1653 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_4" type=
"checkbox" id=
"__nav_6_4" >
1655 <label class=
"md-nav__link" for=
"__nav_6_4">
1656 Migrating from WSC
3.0
1657 <span class=
"md-nav__icon md-icon"></span>
1659 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.0" data-md-level=
"2">
1660 <label class=
"md-nav__title" for=
"__nav_6_4">
1661 <span class=
"md-nav__icon md-icon"></span>
1662 Migrating from WSC
3.0
1664 <ul class=
"md-nav__list" data-md-scrollfix
>
1670 <li class=
"md-nav__item">
1671 <a href=
"../../../../migration/wsc30/php/" class=
"md-nav__link">
1682 <li class=
"md-nav__item">
1683 <a href=
"../../../../migration/wsc30/javascript/" class=
"md-nav__link">
1694 <li class=
"md-nav__item">
1695 <a href=
"../../../../migration/wsc30/templates/" class=
"md-nav__link">
1706 <li class=
"md-nav__item">
1707 <a href=
"../../../../migration/wsc30/css/" class=
"md-nav__link">
1718 <li class=
"md-nav__item">
1719 <a href=
"../../../../migration/wsc30/package/" class=
"md-nav__link">
1737 <li class=
"md-nav__item md-nav__item--nested">
1740 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_5" type=
"checkbox" id=
"__nav_6_5" >
1742 <label class=
"md-nav__link" for=
"__nav_6_5">
1743 Migrating from WCF
2.1
1744 <span class=
"md-nav__icon md-icon"></span>
1746 <nav class=
"md-nav" aria-label=
"Migrating from WCF 2.1" data-md-level=
"2">
1747 <label class=
"md-nav__title" for=
"__nav_6_5">
1748 <span class=
"md-nav__icon md-icon"></span>
1749 Migrating from WCF
2.1
1751 <ul class=
"md-nav__list" data-md-scrollfix
>
1757 <li class=
"md-nav__item">
1758 <a href=
"../../../../migration/wcf21/php/" class=
"md-nav__link">
1769 <li class=
"md-nav__item">
1770 <a href=
"../../../../migration/wcf21/templates/" class=
"md-nav__link">
1781 <li class=
"md-nav__item">
1782 <a href=
"../../../../migration/wcf21/css/" class=
"md-nav__link">
1793 <li class=
"md-nav__item">
1794 <a href=
"../../../../migration/wcf21/package/" class=
"md-nav__link">
1821 <li class=
"md-nav__item md-nav__item--nested">
1824 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7" type=
"checkbox" id=
"__nav_7" >
1826 <label class=
"md-nav__link" for=
"__nav_7">
1828 <span class=
"md-nav__icon md-icon"></span>
1830 <nav class=
"md-nav" aria-label=
"Tutorials" data-md-level=
"1">
1831 <label class=
"md-nav__title" for=
"__nav_7">
1832 <span class=
"md-nav__icon md-icon"></span>
1835 <ul class=
"md-nav__list" data-md-scrollfix
>
1842 <li class=
"md-nav__item md-nav__item--nested">
1845 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7_1" type=
"checkbox" id=
"__nav_7_1" >
1847 <label class=
"md-nav__link" for=
"__nav_7_1">
1849 <span class=
"md-nav__icon md-icon"></span>
1851 <nav class=
"md-nav" aria-label=
"Tutorial Series" data-md-level=
"2">
1852 <label class=
"md-nav__title" for=
"__nav_7_1">
1853 <span class=
"md-nav__icon md-icon"></span>
1856 <ul class=
"md-nav__list" data-md-scrollfix
>
1862 <li class=
"md-nav__item">
1863 <a href=
"../../../../tutorial/series/overview/" class=
"md-nav__link">
1874 <li class=
"md-nav__item">
1875 <a href=
"../../../../tutorial/series/part_1/" class=
"md-nav__link">
1886 <li class=
"md-nav__item">
1887 <a href=
"../../../../tutorial/series/part_2/" class=
"md-nav__link">
1898 <li class=
"md-nav__item">
1899 <a href=
"../../../../tutorial/series/part_3/" class=
"md-nav__link">
1926 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
1927 <div class=
"md-sidebar__scrollwrap">
1928 <div class=
"md-sidebar__inner">
1930 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1936 <label class=
"md-nav__title" for=
"__toc">
1937 <span class=
"md-nav__icon md-icon"></span>
1940 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
1942 <li class=
"md-nav__item">
1943 <a href=
"#advantages-of-form-builder" class=
"md-nav__link">
1944 Advantages of Form Builder
1949 <li class=
"md-nav__item">
1950 <a href=
"#form-builder-components" class=
"md-nav__link">
1951 Form Builder Components
1956 <li class=
"md-nav__item">
1957 <a href=
"#abstractformbuilderform" class=
"md-nav__link">
1958 AbstractFormBuilderForm
1963 <li class=
"md-nav__item">
1964 <a href=
"#dialogformdocument" class=
"md-nav__link">
1978 <div class=
"md-content" data-md-component=
"content">
1979 <article class=
"md-content__inner md-typeset">
1982 <a href=
"https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/php/api/form_builder/overview.md" title=
"Edit this page" class=
"md-content__button md-icon">
1983 <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>
1987 <h1 id=
"form-builder">Form Builder
<a class=
"headerlink" href=
"#form-builder" title=
"Permanent link">#
</a></h1>
1988 <div class=
"admonition info">
1989 <p class=
"admonition-title">Form builder is only available since WoltLab Suite Core
5.2.
</p>
1991 <div class=
"admonition info">
1992 <p class=
"admonition-title">The
<a href=
"../../../../migration/wsc31/form-builder/">migration guide for WoltLab Suite Core
5.2</a> provides some examples of how to migrate existing forms to form builder that can also help in understanding form builder if the old way of creating forms is familiar.
</p>
1994 <h2 id=
"advantages-of-form-builder">Advantages of Form Builder
<a class=
"headerlink" href=
"#advantages-of-form-builder" title=
"Permanent link">#
</a></h2>
1995 <p>WoltLab Suite
5.2 introduces a new powerful way of creating forms: form builder.
1996 Before taking a closer look at form builder, let us recap how forms are created in previous versions:
1997 In general, for each form field, there is a corresponding property of the form's PHP class whose value has to be read from the request data, validated, and passed to the database object action to store the value in a database table.
1998 When editing an object, the property's value has to be set using the value of the corresponding property of the edited object.
1999 In the form's template, you have to write the
<code><form
></code> element with all of its children: the
<code><section
></code> elements, the
<code><dl
></code> elements, and, of course, the form fields themselves.
2000 In summary, this way of creating forms creates much duplicate or at least very similar code and makes it very time consuming if the structure of forms in general or a specific type of form field has to be changed.
</p>
2001 <p>Form builder, in contrast, relies on PHP objects representing each component of the form, from the form itself down to each form field.
2002 This approach makes creating forms as easy as creating some PHP objects, populating them with all the relevant data, and one line of code in the template to print the form.
</p>
2003 <h2 id=
"form-builder-components">Form Builder Components
<a class=
"headerlink" href=
"#form-builder-components" title=
"Permanent link">#
</a></h2>
2004 <p>Form builder consists of several components that are presented on the following pages:
</p>
2006 <li><a href=
"../structure/">Structure of form builder
</a></li>
2007 <li><a href=
"../validation_data/">Form validation and form data
</a></li>
2008 <li><a href=
"../dependencies/">Form node dependencies
</a></li>
2010 <div class=
"admonition warning">
2011 <p class=
"admonition-title">In general, form builder provides default implementation of interfaces by providing either abstract classes or traits. It is expected that the interfaces are always implemented using these abstract classes and traits! This way, if new methods are added to the interfaces, default implementations can be provided by the abstract classes and traits without causing backwards compatibility problems.
</p>
2013 <h2 id=
"abstractformbuilderform"><code>AbstractFormBuilderForm
</code><a class=
"headerlink" href=
"#abstractformbuilderform" title=
"Permanent link">#
</a></h2>
2014 <p>To make using form builder easier,
<code>AbstractFormBuilderForm
</code> extends
<code>AbstractForm
</code> and provides most of the code needed to set up a form (of course without specific fields, those have to be added by the concrete form class), like reading and validating form values and using a database object action to use the form data to create or update a database object.
</p>
2015 <p>In addition to the existing methods inherited by
<code>AbstractForm
</code>,
<code>AbstractFormBuilderForm
</code> provides the following methods:
</p>
2018 <p><code>buildForm()
</code> builds the form in the following steps:
</p>
2021 <p>Call
<code>AbtractFormBuilderForm::createForm()
</code> to create the
<code>IFormDocument
</code> object and add the form fields.
</p>
2023 <li>Call
<code>IFormDocument::build()
</code> to build the form.
</li>
2024 <li>Call
<code>AbtractFormBuilderForm::finalizeForm()
</code> to finalize the form like adding dependencies.
</li>
2026 <p>Additionally, between steps
1 and
2 and after step
3, the method provides two events,
<code>createForm
</code> and
<code>buildForm
</code> to allow plugins to register event listeners to execute additional code at the right point in time.
2027 -
<code>createForm()
</code> creates the
<code>FormDocument
</code> object and sets the form mode.
2028 Classes extending
<code>AbstractFormBuilderForm
</code> have to override this method (and call
<code>parent::createForm()
</code> as the first line in the overridden method) to add concrete form containers and form fields to the bare form document.
2029 -
<code>finalizeForm()
</code> is called after the form has been built and the complete form hierarchy has been established.
2030 This method should be overridden to add dependencies, for example.
2031 -
<code>setFormAction()
</code> is called at the end of
<code>readData()
</code> and sets the form document’s action based on the controller class name and whether an object is currently edited.
2032 - If an object is edited, at the beginning of
<code>readData()
</code>,
<code>setFormObjectData()
</code> is called which calls
<code>IFormDocument::loadValuesFromObject()
</code>.
2033 If values need to be loaded from additional sources, this method should be used for that.
</p>
2034 <p><code>AbstractFormBuilderForm
</code> also provides the following (public) properties:
</p>
2036 <li><code>$form
</code> contains the
<code>IFormDocument
</code> object created in
<code>createForm()
</code>.
</li>
2037 <li><code>$formAction
</code> is either
<code>create
</code> (default) or
<code>edit
</code> and handles which method of the database object is called by default (
<code>create
</code> is called for
<code>$formAction = 'create'
</code> and
<code>update
</code> is called for
<code>$formAction = 'edit'
</code>) and is used to set the value of the
<code>action
</code> template variable.
</li>
2038 <li><code>$formObject
</code> contains the
<code>IStorableObject
</code> if the form is used to edit an existing object.
2039 For forms used to create objects,
<code>$formObject
</code> is always
<code>null
</code>.
2040 Edit forms have to manually identify the edited object based on the request data and set the value of
<code>$formObject
</code>.
</li>
2041 <li><code>$objectActionName
</code> can be used to set an alternative action to be executed by the database object action that deviates from the default action determined by the value of
<code>$formAction
</code>.
</li>
2042 <li><code>$objectActionClass
</code> is the name of the database object action class that is used to create or update the database object.
</li>
2044 <h2 id=
"dialogformdocument"><code>DialogFormDocument
</code><a class=
"headerlink" href=
"#dialogformdocument" title=
"Permanent link">#
</a></h2>
2045 <p>Form builder forms can also be used in dialogs.
2046 For such forms,
<code>DialogFormDocument
</code> should be used which provides the additional methods
<code>cancelable($cancelable = true)
</code> and
<code>isCancelable()
</code> to set and check if the dialog can be canceled.
2047 If a dialog form can be canceled, a cancel button is added.
</p>
2048 <p>If the dialog form is fetched via an AJAX request,
<code>IFormDocument::ajax()
</code> has to be called.
2049 AJAX forms are registered with
<code>WoltLabSuite/Core/Form/Builder/Manager
</code> which also supports getting all of the data of a form via the
<code>getData(formId)
</code> function.
2050 The
<code>getData()
</code> function relies on all form fields creating and registering a
<code>WoltLabSuite/Core/Form/Builder/Field/Field
</code> object that provides the data of a specific field.
</p>
2051 <p>To make it as easy as possible to work with AJAX forms in dialogs,
<code>WoltLabSuite/Core/Form/Builder/Dialog
</code> (abbreviated as
<code>FormBuilderDialog
</code> from now on) should generally be used instead of
<code>WoltLabSuite/Core/Form/Builder/Manager
</code> directly.
2052 The constructor of
<code>FormBuilderDialog
</code> expects the following parameters:
</p>
2054 <li><code>dialogId
</code>: id of the dialog element
</li>
2055 <li><code>className
</code>: PHP class used to get the form dialog (and save the data if
<code>options.submitActionName
</code> is set)
</li>
2056 <li><code>actionName
</code>: name of the action/method of
<code>className
</code> that returns the dialog; the method is expected to return an array with
<code>formId
</code> containg the id of the returned form and
<code>dialog
</code> containing the rendered form dialog
</li>
2057 <li><code>options
</code>: additional options:
</li>
2058 <li><code>actionParameters
</code> (default: empty): additional parameters sent during AJAX requests
</li>
2059 <li><code>destroyOnClose
</code> (default:
<code>false
</code>): if
<code>true
</code>, whenever the dialog is closed, the form is destroyed so that a new form is fetched if the dialog is opened again
</li>
2060 <li><code>dialog
</code>: additional dialog options used as
<code>options
</code> during dialog setup
</li>
2061 <li><code>onSubmit
</code>: callback when the form is submitted (takes precedence over
<code>submitActionName
</code>)
</li>
2062 <li><code>submitActionName
</code> (default: not set): name of the action/method of
<code>className
</code> called when the form is submitted
</li>
2064 <p>The three public functions of
<code>FormBuilderDialog
</code> are:
</p>
2066 <li><code>destroy()
</code> destroys the dialog, the form, and all of the form fields.
</li>
2067 <li><code>getData()
</code> returns a Promise that returns the form data.
</li>
2068 <li><code>open()
</code> opens the dialog.
</li>
2071 <div class=
"highlight"><pre><span></span><code><span class=
"nx">require
</span><span class=
"p">([
</span><span class=
"s1">'WoltLabSuite/Core/Form/Builder/Dialog
'</span><span class=
"p">],
</span> <span class=
"kd">function
</span><span class=
"p">(
</span><span class=
"nx">FormBuilderDialog
</span><span class=
"p">)
</span> <span class=
"p">{
</span>
2072 <span class=
"kd">var
</span> <span class=
"nx">dialog
</span> <span class=
"o">=
</span> <span class=
"k">new
</span> <span class=
"nx">FormBuilderDialog
</span><span class=
"p">(
</span>
2073 <span class=
"s1">'testDialog
'</span><span class=
"p">,
</span>
2074 <span class=
"s1">'wcf\\data\\test\\TestAction
'</span><span class=
"p">,
</span>
2075 <span class=
"s1">'getDialog
'</span><span class=
"p">,
</span>
2076 <span class=
"p">{
</span>
2077 <span class=
"nx">destroyOnClose
</span><span class=
"o">:
</span> <span class=
"kc">true
</span><span class=
"p">,
</span>
2078 <span class=
"nx">dialog
</span><span class=
"o">:
</span> <span class=
"p">{
</span>
2079 <span class=
"nx">title
</span><span class=
"o">:
</span> <span class=
"s1">'Test Dialog
'</span>
2080 <span class=
"p">},
</span>
2081 <span class=
"nx">submitActionName
</span><span class=
"o">:
</span> <span class=
"s1">'saveDialog
'</span>
2082 <span class=
"p">}
</span>
2083 <span class=
"p">);
</span>
2085 <span class=
"nx">elById
</span><span class=
"p">(
</span><span class=
"s1">'testDialogButton
'</span><span class=
"p">).
</span><span class=
"nx">addEventListener
</span><span class=
"p">(
</span><span class=
"s1">'click
'</span><span class=
"p">,
</span> <span class=
"kd">function
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2086 <span class=
"nx">dialog
</span><span class=
"p">.
</span><span class=
"nx">open
</span><span class=
"p">();
</span>
2087 <span class=
"p">});
</span>
2088 <span class=
"p">});
</span>
2095 <div class=
"md-source-date">
2098 Last update:
2021-
01-
15
2117 <footer class=
"md-footer">
2119 <nav class=
"md-footer__inner md-grid" aria-label=
"Footer">
2121 <a href=
"../../events/" class=
"md-footer__link md-footer__link--prev" rel=
"prev">
2122 <div class=
"md-footer__button md-icon">
2123 <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>
2125 <div class=
"md-footer__title">
2126 <div class=
"md-ellipsis">
2127 <span class=
"md-footer__direction">
2136 <a href=
"../structure/" class=
"md-footer__link md-footer__link--next" rel=
"next">
2137 <div class=
"md-footer__title">
2138 <div class=
"md-ellipsis">
2139 <span class=
"md-footer__direction">
2145 <div class=
"md-footer__button md-icon">
2146 <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>
2152 <div class=
"md-footer-meta md-typeset">
2153 <div class=
"md-footer-meta__inner md-grid">
2154 <div class=
"md-footer-copyright">
2156 <div class=
"md-footer-copyright__highlight">
2157 Copyright ©
2020 WoltLab GmbH
2161 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
2166 <div class=
"md-footer-copyright">
2167 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
2168 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
2175 <div class=
"md-dialog" data-md-component=
"dialog">
2176 <div class=
"md-dialog__inner md-typeset"></div>
2178 <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>
2181 <script src=
"../../../../assets/javascripts/bundle.d892486b.min.js"></script>