3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
12 <link rel=
"shortcut icon" href=
"../../../../assets/default.favicon.ico">
13 <meta name=
"generator" content=
"mkdocs-1.1.2, mkdocs-material-7.0.5">
17 <title>Overview - WoltLab Suite Documentation
</title>
21 <link rel=
"stylesheet" href=
"../../../../assets/stylesheets/main.77f3fd56.min.css">
24 <link rel=
"stylesheet" href=
"../../../../assets/stylesheets/palette.7fa14f5b.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=
"">
56 <input class=
"md-toggle" data-md-toggle=
"drawer" type=
"checkbox" id=
"__drawer" autocomplete=
"off">
57 <input class=
"md-toggle" data-md-toggle=
"search" type=
"checkbox" id=
"__search" autocomplete=
"off">
58 <label class=
"md-overlay" for=
"__drawer"></label>
59 <div data-md-component=
"skip">
62 <a href=
"#form-builder" class=
"md-skip">
67 <div data-md-component=
"announce">
69 <aside class=
"md-announce">
70 <div class=
"md-announce__inner md-grid md-typeset">
72 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
81 <header class=
"md-header" data-md-component=
"header">
82 <nav class=
"md-header__inner md-grid" aria-label=
"Header">
83 <a href=
"../../../.." title=
"WoltLab Suite Documentation" class=
"md-header__button md-logo" aria-label=
"WoltLab Suite Documentation">
85 <img src=
"../../../../assets/logo.png" alt=
"logo">
88 <label class=
"md-header__button md-icon" for=
"__drawer">
89 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
91 <div class=
"md-header__title" data-md-component=
"header-title">
92 <div class=
"md-header__ellipsis">
93 <div class=
"md-header__topic">
94 <span class=
"md-ellipsis">
95 WoltLab Suite Documentation
98 <div class=
"md-header__topic" data-md-component=
"header-topic">
99 <span class=
"md-ellipsis">
107 <div class=
"md-header__options">
112 <div class=
"md-header__source">
114 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
115 <div class=
"md-source__icon md-icon">
117 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05L244 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>
119 <div class=
"md-source__repository">
128 <div class=
"md-container" data-md-component=
"container">
133 <main class=
"md-main" data-md-component=
"main">
134 <div class=
"md-main__inner md-grid">
138 <div class=
"md-sidebar md-sidebar--primary" data-md-component=
"sidebar" data-md-type=
"navigation" >
139 <div class=
"md-sidebar__scrollwrap">
140 <div class=
"md-sidebar__inner">
146 <nav class=
"md-nav md-nav--primary" aria-label=
"Navigation" data-md-level=
"0">
147 <label class=
"md-nav__title" for=
"__drawer">
148 <a href=
"../../../.." title=
"WoltLab Suite Documentation" class=
"md-nav__button md-logo" aria-label=
"WoltLab Suite Documentation">
150 <img src=
"../../../../assets/logo.png" alt=
"logo">
153 WoltLab Suite Documentation
156 <div class=
"md-nav__source">
158 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
159 <div class=
"md-source__icon md-icon">
161 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05L244 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>
163 <div class=
"md-source__repository">
169 <ul class=
"md-nav__list" data-md-scrollfix
>
178 <li class=
"md-nav__item">
179 <a href=
"../../../../getting-started/" class=
"md-nav__link">
196 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
199 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2" type=
"checkbox" id=
"__nav_2" checked
>
201 <label class=
"md-nav__link" for=
"__nav_2">
203 <span class=
"md-nav__icon md-icon"></span>
205 <nav class=
"md-nav" aria-label=
"PHP API" data-md-level=
"1">
206 <label class=
"md-nav__title" for=
"__nav_2">
207 <span class=
"md-nav__icon md-icon"></span>
210 <ul class=
"md-nav__list" data-md-scrollfix
>
216 <li class=
"md-nav__item">
217 <a href=
"../../../pages/" class=
"md-nav__link">
228 <li class=
"md-nav__item">
229 <a href=
"../../../database-objects/" class=
"md-nav__link">
240 <li class=
"md-nav__item">
241 <a href=
"../../../database-access/" class=
"md-nav__link">
252 <li class=
"md-nav__item">
253 <a href=
"../../../exceptions/" class=
"md-nav__link">
267 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
270 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5" type=
"checkbox" id=
"__nav_2_5" checked
>
272 <label class=
"md-nav__link" for=
"__nav_2_5">
274 <span class=
"md-nav__icon md-icon"></span>
276 <nav class=
"md-nav" aria-label=
"API" data-md-level=
"2">
277 <label class=
"md-nav__title" for=
"__nav_2_5">
278 <span class=
"md-nav__icon md-icon"></span>
281 <ul class=
"md-nav__list" data-md-scrollfix
>
287 <li class=
"md-nav__item">
288 <a href=
"../../caches/" class=
"md-nav__link">
299 <li class=
"md-nav__item">
300 <a href=
"../../comments/" class=
"md-nav__link">
311 <li class=
"md-nav__item">
312 <a href=
"../../cronjobs/" class=
"md-nav__link">
323 <li class=
"md-nav__item">
324 <a href=
"../../events/" class=
"md-nav__link">
338 <li class=
"md-nav__item md-nav__item--active md-nav__item--nested">
341 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_5" type=
"checkbox" id=
"__nav_2_5_5" checked
>
343 <label class=
"md-nav__link" for=
"__nav_2_5_5">
345 <span class=
"md-nav__icon md-icon"></span>
347 <nav class=
"md-nav" aria-label=
"Form Builder" data-md-level=
"3">
348 <label class=
"md-nav__title" for=
"__nav_2_5_5">
349 <span class=
"md-nav__icon md-icon"></span>
352 <ul class=
"md-nav__list" data-md-scrollfix
>
360 <li class=
"md-nav__item md-nav__item--active">
362 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"toc" type=
"checkbox" id=
"__toc">
367 <label class=
"md-nav__link md-nav__link--active" for=
"__toc">
369 <span class=
"md-nav__icon md-icon"></span>
372 <a href=
"./" class=
"md-nav__link md-nav__link--active">
377 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
383 <label class=
"md-nav__title" for=
"__toc">
384 <span class=
"md-nav__icon md-icon"></span>
387 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
389 <li class=
"md-nav__item">
390 <a href=
"#advantages-of-form-builder" class=
"md-nav__link">
391 Advantages of Form Builder
396 <li class=
"md-nav__item">
397 <a href=
"#form-builder-components" class=
"md-nav__link">
398 Form Builder Components
403 <li class=
"md-nav__item">
404 <a href=
"#abstractformbuilderform" class=
"md-nav__link">
405 AbstractFormBuilderForm
410 <li class=
"md-nav__item">
411 <a href=
"#dialogformdocument" class=
"md-nav__link">
429 <li class=
"md-nav__item">
430 <a href=
"../structure/" class=
"md-nav__link">
441 <li class=
"md-nav__item">
442 <a href=
"../form_fields/" class=
"md-nav__link">
453 <li class=
"md-nav__item">
454 <a href=
"../validation_data/" class=
"md-nav__link">
465 <li class=
"md-nav__item">
466 <a href=
"../dependencies/" class=
"md-nav__link">
483 <li class=
"md-nav__item">
484 <a href=
"../../package_installation_plugins/" class=
"md-nav__link">
485 Package Installation Plugins
495 <li class=
"md-nav__item">
496 <a href=
"../../user_activity_points/" class=
"md-nav__link">
507 <li class=
"md-nav__item">
508 <a href=
"../../user_notifications/" class=
"md-nav__link">
519 <li class=
"md-nav__item">
520 <a href=
"../../sitemaps/" class=
"md-nav__link">
537 <li class=
"md-nav__item">
538 <a href=
"../../../code-style/" class=
"md-nav__link">
549 <li class=
"md-nav__item">
550 <a href=
"../../../apps/" class=
"md-nav__link">
561 <li class=
"md-nav__item">
562 <a href=
"../../../gdpr/" class=
"md-nav__link">
583 <li class=
"md-nav__item md-nav__item--nested">
586 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_3" type=
"checkbox" id=
"__nav_3" >
588 <label class=
"md-nav__link" for=
"__nav_3">
589 Languages, Templates & CSS
590 <span class=
"md-nav__icon md-icon"></span>
592 <nav class=
"md-nav" aria-label=
"Languages, Templates & CSS" data-md-level=
"1">
593 <label class=
"md-nav__title" for=
"__nav_3">
594 <span class=
"md-nav__icon md-icon"></span>
595 Languages, Templates & CSS
597 <ul class=
"md-nav__list" data-md-scrollfix
>
603 <li class=
"md-nav__item">
604 <a href=
"../../../../view/languages/" class=
"md-nav__link">
615 <li class=
"md-nav__item">
616 <a href=
"../../../../view/templates/" class=
"md-nav__link">
627 <li class=
"md-nav__item">
628 <a href=
"../../../../view/css/" class=
"md-nav__link">
649 <li class=
"md-nav__item md-nav__item--nested">
652 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4" type=
"checkbox" id=
"__nav_4" >
654 <label class=
"md-nav__link" for=
"__nav_4">
656 <span class=
"md-nav__icon md-icon"></span>
658 <nav class=
"md-nav" aria-label=
"JavaScript API" data-md-level=
"1">
659 <label class=
"md-nav__title" for=
"__nav_4">
660 <span class=
"md-nav__icon md-icon"></span>
663 <ul class=
"md-nav__list" data-md-scrollfix
>
669 <li class=
"md-nav__item">
670 <a href=
"../../../../javascript/general-usage/" class=
"md-nav__link">
682 <li class=
"md-nav__item md-nav__item--nested">
685 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4_2" type=
"checkbox" id=
"__nav_4_2" >
687 <label class=
"md-nav__link" for=
"__nav_4_2">
689 <span class=
"md-nav__icon md-icon"></span>
691 <nav class=
"md-nav" aria-label=
"New API" data-md-level=
"2">
692 <label class=
"md-nav__title" for=
"__nav_4_2">
693 <span class=
"md-nav__icon md-icon"></span>
696 <ul class=
"md-nav__list" data-md-scrollfix
>
702 <li class=
"md-nav__item">
703 <a href=
"../../../../javascript/new-api_writing-a-module/" class=
"md-nav__link">
714 <li class=
"md-nav__item">
715 <a href=
"../../../../javascript/new-api_data-structures/" class=
"md-nav__link">
726 <li class=
"md-nav__item">
727 <a href=
"../../../../javascript/new-api_core/" class=
"md-nav__link">
738 <li class=
"md-nav__item">
739 <a href=
"../../../../javascript/new-api_dom/" class=
"md-nav__link">
750 <li class=
"md-nav__item">
751 <a href=
"../../../../javascript/new-api_events/" class=
"md-nav__link">
762 <li class=
"md-nav__item">
763 <a href=
"../../../../javascript/new-api_ajax/" class=
"md-nav__link">
774 <li class=
"md-nav__item">
775 <a href=
"../../../../javascript/new-api_dialogs/" class=
"md-nav__link">
786 <li class=
"md-nav__item">
787 <a href=
"../../../../javascript/new-api_browser/" class=
"md-nav__link">
788 Browser and Screen Sizes
798 <li class=
"md-nav__item">
799 <a href=
"../../../../javascript/new-api_ui/" class=
"md-nav__link">
816 <li class=
"md-nav__item">
817 <a href=
"../../../../javascript/legacy-api/" class=
"md-nav__link">
828 <li class=
"md-nav__item">
829 <a href=
"../../../../javascript/helper-functions/" class=
"md-nav__link">
840 <li class=
"md-nav__item">
841 <a href=
"../../../../javascript/code-snippets/" class=
"md-nav__link">
862 <li class=
"md-nav__item md-nav__item--nested">
865 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5" type=
"checkbox" id=
"__nav_5" >
867 <label class=
"md-nav__link" for=
"__nav_5">
869 <span class=
"md-nav__icon md-icon"></span>
871 <nav class=
"md-nav" aria-label=
"Package Components" data-md-level=
"1">
872 <label class=
"md-nav__title" for=
"__nav_5">
873 <span class=
"md-nav__icon md-icon"></span>
876 <ul class=
"md-nav__list" data-md-scrollfix
>
882 <li class=
"md-nav__item">
883 <a href=
"../../../../package/package-xml/" class=
"md-nav__link">
895 <li class=
"md-nav__item md-nav__item--nested">
898 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5_2" type=
"checkbox" id=
"__nav_5_2" >
900 <label class=
"md-nav__link" for=
"__nav_5_2">
902 <span class=
"md-nav__icon md-icon"></span>
904 <nav class=
"md-nav" aria-label=
"PIPs" data-md-level=
"2">
905 <label class=
"md-nav__title" for=
"__nav_5_2">
906 <span class=
"md-nav__icon md-icon"></span>
909 <ul class=
"md-nav__list" data-md-scrollfix
>
915 <li class=
"md-nav__item">
916 <a href=
"../../../../package/pip/" class=
"md-nav__link">
927 <li class=
"md-nav__item">
928 <a href=
"../../../../package/pip/acl-option/" class=
"md-nav__link">
939 <li class=
"md-nav__item">
940 <a href=
"../../../../package/pip/acp-menu/" class=
"md-nav__link">
951 <li class=
"md-nav__item">
952 <a href=
"../../../../package/pip/acp-search-provider/" class=
"md-nav__link">
963 <li class=
"md-nav__item">
964 <a href=
"../../../../package/pip/acp-template/" class=
"md-nav__link">
975 <li class=
"md-nav__item">
976 <a href=
"../../../../package/pip/bbcode/" class=
"md-nav__link">
987 <li class=
"md-nav__item">
988 <a href=
"../../../../package/pip/box/" class=
"md-nav__link">
999 <li class=
"md-nav__item">
1000 <a href=
"../../../../package/pip/clipboard-action/" class=
"md-nav__link">
1011 <li class=
"md-nav__item">
1012 <a href=
"../../../../package/pip/core-object/" class=
"md-nav__link">
1023 <li class=
"md-nav__item">
1024 <a href=
"../../../../package/pip/cronjob/" class=
"md-nav__link">
1035 <li class=
"md-nav__item">
1036 <a href=
"../../../../package/pip/event-listener/" class=
"md-nav__link">
1047 <li class=
"md-nav__item">
1048 <a href=
"../../../../package/pip/file/" class=
"md-nav__link">
1059 <li class=
"md-nav__item">
1060 <a href=
"../../../../package/pip/language/" class=
"md-nav__link">
1071 <li class=
"md-nav__item">
1072 <a href=
"../../../../package/pip/media-provider/" class=
"md-nav__link">
1083 <li class=
"md-nav__item">
1084 <a href=
"../../../../package/pip/menu/" class=
"md-nav__link">
1095 <li class=
"md-nav__item">
1096 <a href=
"../../../../package/pip/menu-item/" class=
"md-nav__link">
1107 <li class=
"md-nav__item">
1108 <a href=
"../../../../package/pip/object-type/" class=
"md-nav__link">
1119 <li class=
"md-nav__item">
1120 <a href=
"../../../../package/pip/object-type-definition/" class=
"md-nav__link">
1121 objectTypeDefinition
1131 <li class=
"md-nav__item">
1132 <a href=
"../../../../package/pip/option/" class=
"md-nav__link">
1143 <li class=
"md-nav__item">
1144 <a href=
"../../../../package/pip/page/" class=
"md-nav__link">
1155 <li class=
"md-nav__item">
1156 <a href=
"../../../../package/pip/pip/" class=
"md-nav__link">
1167 <li class=
"md-nav__item">
1168 <a href=
"../../../../package/pip/script/" class=
"md-nav__link">
1179 <li class=
"md-nav__item">
1180 <a href=
"../../../../package/pip/smiley/" class=
"md-nav__link">
1191 <li class=
"md-nav__item">
1192 <a href=
"../../../../package/pip/sql/" class=
"md-nav__link">
1203 <li class=
"md-nav__item">
1204 <a href=
"../../../../package/pip/style/" class=
"md-nav__link">
1215 <li class=
"md-nav__item">
1216 <a href=
"../../../../package/pip/template/" class=
"md-nav__link">
1227 <li class=
"md-nav__item">
1228 <a href=
"../../../../package/pip/template-listener/" class=
"md-nav__link">
1239 <li class=
"md-nav__item">
1240 <a href=
"../../../../package/pip/user-group-option/" class=
"md-nav__link">
1251 <li class=
"md-nav__item">
1252 <a href=
"../../../../package/pip/user-menu/" class=
"md-nav__link">
1263 <li class=
"md-nav__item">
1264 <a href=
"../../../../package/pip/user-notification-event/" class=
"md-nav__link">
1265 userNotificationEvent
1275 <li class=
"md-nav__item">
1276 <a href=
"../../../../package/pip/user-option/" class=
"md-nav__link">
1287 <li class=
"md-nav__item">
1288 <a href=
"../../../../package/pip/user-profile-menu/" class=
"md-nav__link">
1305 <li class=
"md-nav__item">
1306 <a href=
"../../../../package/database-php-api/" class=
"md-nav__link">
1327 <li class=
"md-nav__item md-nav__item--nested">
1330 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6" type=
"checkbox" id=
"__nav_6" >
1332 <label class=
"md-nav__link" for=
"__nav_6">
1334 <span class=
"md-nav__icon md-icon"></span>
1336 <nav class=
"md-nav" aria-label=
"Migration" data-md-level=
"1">
1337 <label class=
"md-nav__title" for=
"__nav_6">
1338 <span class=
"md-nav__icon md-icon"></span>
1341 <ul class=
"md-nav__list" data-md-scrollfix
>
1348 <li class=
"md-nav__item md-nav__item--nested">
1351 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_1" type=
"checkbox" id=
"__nav_6_1" >
1353 <label class=
"md-nav__link" for=
"__nav_6_1">
1354 Migrating from WSC
5.3
1355 <span class=
"md-nav__icon md-icon"></span>
1357 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.3" data-md-level=
"2">
1358 <label class=
"md-nav__title" for=
"__nav_6_1">
1359 <span class=
"md-nav__icon md-icon"></span>
1360 Migrating from WSC
5.3
1362 <ul class=
"md-nav__list" data-md-scrollfix
>
1368 <li class=
"md-nav__item">
1369 <a href=
"../../../../migration/wsc53/php/" class=
"md-nav__link">
1380 <li class=
"md-nav__item">
1381 <a href=
"../../../../migration/wsc53/session/" class=
"md-nav__link">
1382 Session Handling and Authentication
1392 <li class=
"md-nav__item">
1393 <a href=
"../../../../migration/wsc53/javascript/" class=
"md-nav__link">
1404 <li class=
"md-nav__item">
1405 <a href=
"../../../../migration/wsc53/templates/" class=
"md-nav__link">
1416 <li class=
"md-nav__item">
1417 <a href=
"../../../../migration/wsc53/libraries/" class=
"md-nav__link">
1418 Third Party Libraries
1435 <li class=
"md-nav__item md-nav__item--nested">
1438 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_2" type=
"checkbox" id=
"__nav_6_2" >
1440 <label class=
"md-nav__link" for=
"__nav_6_2">
1441 Migrating from WSC
5.2
1442 <span class=
"md-nav__icon md-icon"></span>
1444 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.2" data-md-level=
"2">
1445 <label class=
"md-nav__title" for=
"__nav_6_2">
1446 <span class=
"md-nav__icon md-icon"></span>
1447 Migrating from WSC
5.2
1449 <ul class=
"md-nav__list" data-md-scrollfix
>
1455 <li class=
"md-nav__item">
1456 <a href=
"../../../../migration/wsc52/php/" class=
"md-nav__link">
1467 <li class=
"md-nav__item">
1468 <a href=
"../../../../migration/wsc52/templates/" class=
"md-nav__link">
1469 Templates and Languages
1479 <li class=
"md-nav__item">
1480 <a href=
"../../../../migration/wsc52/libraries/" class=
"md-nav__link">
1481 Third Party Libraries
1498 <li class=
"md-nav__item md-nav__item--nested">
1501 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_3" type=
"checkbox" id=
"__nav_6_3" >
1503 <label class=
"md-nav__link" for=
"__nav_6_3">
1504 Migrating from WSC
3.1
1505 <span class=
"md-nav__icon md-icon"></span>
1507 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.1" data-md-level=
"2">
1508 <label class=
"md-nav__title" for=
"__nav_6_3">
1509 <span class=
"md-nav__icon md-icon"></span>
1510 Migrating from WSC
3.1
1512 <ul class=
"md-nav__list" data-md-scrollfix
>
1518 <li class=
"md-nav__item">
1519 <a href=
"../../../../migration/wsc31/php/" class=
"md-nav__link">
1537 <li class=
"md-nav__item md-nav__item--nested">
1540 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_4" type=
"checkbox" id=
"__nav_6_4" >
1542 <label class=
"md-nav__link" for=
"__nav_6_4">
1543 Migrating from WSC
3.0
1544 <span class=
"md-nav__icon md-icon"></span>
1546 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.0" data-md-level=
"2">
1547 <label class=
"md-nav__title" for=
"__nav_6_4">
1548 <span class=
"md-nav__icon md-icon"></span>
1549 Migrating from WSC
3.0
1551 <ul class=
"md-nav__list" data-md-scrollfix
>
1557 <li class=
"md-nav__item">
1558 <a href=
"../../../../migration/wsc30/php/" class=
"md-nav__link">
1569 <li class=
"md-nav__item">
1570 <a href=
"../../../../migration/wsc30/javascript/" class=
"md-nav__link">
1581 <li class=
"md-nav__item">
1582 <a href=
"../../../../migration/wsc30/templates/" class=
"md-nav__link">
1593 <li class=
"md-nav__item">
1594 <a href=
"../../../../migration/wsc30/css/" class=
"md-nav__link">
1605 <li class=
"md-nav__item">
1606 <a href=
"../../../../migration/wsc30/package/" class=
"md-nav__link">
1624 <li class=
"md-nav__item md-nav__item--nested">
1627 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_5" type=
"checkbox" id=
"__nav_6_5" >
1629 <label class=
"md-nav__link" for=
"__nav_6_5">
1630 Migrating from WCF
2.1
1631 <span class=
"md-nav__icon md-icon"></span>
1633 <nav class=
"md-nav" aria-label=
"Migrating from WCF 2.1" data-md-level=
"2">
1634 <label class=
"md-nav__title" for=
"__nav_6_5">
1635 <span class=
"md-nav__icon md-icon"></span>
1636 Migrating from WCF
2.1
1638 <ul class=
"md-nav__list" data-md-scrollfix
>
1644 <li class=
"md-nav__item">
1645 <a href=
"../../../../migration/wcf21/php/" class=
"md-nav__link">
1656 <li class=
"md-nav__item">
1657 <a href=
"../../../../migration/wcf21/templates/" class=
"md-nav__link">
1668 <li class=
"md-nav__item">
1669 <a href=
"../../../../migration/wcf21/css/" class=
"md-nav__link">
1680 <li class=
"md-nav__item">
1681 <a href=
"../../../../migration/wcf21/package/" class=
"md-nav__link">
1708 <li class=
"md-nav__item md-nav__item--nested">
1711 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7" type=
"checkbox" id=
"__nav_7" >
1713 <label class=
"md-nav__link" for=
"__nav_7">
1715 <span class=
"md-nav__icon md-icon"></span>
1717 <nav class=
"md-nav" aria-label=
"Tutorials" data-md-level=
"1">
1718 <label class=
"md-nav__title" for=
"__nav_7">
1719 <span class=
"md-nav__icon md-icon"></span>
1722 <ul class=
"md-nav__list" data-md-scrollfix
>
1729 <li class=
"md-nav__item md-nav__item--nested">
1732 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7_1" type=
"checkbox" id=
"__nav_7_1" >
1734 <label class=
"md-nav__link" for=
"__nav_7_1">
1736 <span class=
"md-nav__icon md-icon"></span>
1738 <nav class=
"md-nav" aria-label=
"Tutorial Series" data-md-level=
"2">
1739 <label class=
"md-nav__title" for=
"__nav_7_1">
1740 <span class=
"md-nav__icon md-icon"></span>
1743 <ul class=
"md-nav__list" data-md-scrollfix
>
1749 <li class=
"md-nav__item">
1750 <a href=
"../../../../tutorial/series/overview/" class=
"md-nav__link">
1761 <li class=
"md-nav__item">
1762 <a href=
"../../../../tutorial/series/part_1/" class=
"md-nav__link">
1773 <li class=
"md-nav__item">
1774 <a href=
"../../../../tutorial/series/part_2/" class=
"md-nav__link">
1785 <li class=
"md-nav__item">
1786 <a href=
"../../../../tutorial/series/part_3/" class=
"md-nav__link">
1813 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
1814 <div class=
"md-sidebar__scrollwrap">
1815 <div class=
"md-sidebar__inner">
1817 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1823 <label class=
"md-nav__title" for=
"__toc">
1824 <span class=
"md-nav__icon md-icon"></span>
1827 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
1829 <li class=
"md-nav__item">
1830 <a href=
"#advantages-of-form-builder" class=
"md-nav__link">
1831 Advantages of Form Builder
1836 <li class=
"md-nav__item">
1837 <a href=
"#form-builder-components" class=
"md-nav__link">
1838 Form Builder Components
1843 <li class=
"md-nav__item">
1844 <a href=
"#abstractformbuilderform" class=
"md-nav__link">
1845 AbstractFormBuilderForm
1850 <li class=
"md-nav__item">
1851 <a href=
"#dialogformdocument" class=
"md-nav__link">
1865 <div class=
"md-content" data-md-component=
"content">
1866 <article class=
"md-content__inner md-typeset">
1869 <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">
1870 <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>
1874 <h1 id=
"form-builder">Form Builder
<a class=
"headerlink" href=
"#form-builder" title=
"Permanent link">#
</a></h1>
1875 <div class=
"admonition info">
1876 <p class=
"admonition-title">Form builder is only available since WoltLab Suite Core
5.2.
</p>
1878 <div class=
"admonition info">
1879 <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>
1881 <h2 id=
"advantages-of-form-builder">Advantages of Form Builder
<a class=
"headerlink" href=
"#advantages-of-form-builder" title=
"Permanent link">#
</a></h2>
1882 <p>WoltLab Suite
5.2 introduces a new powerful way of creating forms: form builder.
1883 Before taking a closer look at form builder, let us recap how forms are created in previous versions:
1884 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.
1885 When editing an object, the property's value has to be set using the value of the corresponding property of the edited object.
1886 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.
1887 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>
1888 <p>Form builder, in contrast, relies on PHP objects representing each component of the form, from the form itself down to each form field.
1889 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>
1890 <h2 id=
"form-builder-components">Form Builder Components
<a class=
"headerlink" href=
"#form-builder-components" title=
"Permanent link">#
</a></h2>
1891 <p>Form builder consists of several components that are presented on the following pages:
</p>
1893 <li><a href=
"../structure/">Structure of form builder
</a></li>
1894 <li><a href=
"../validation_data/">Form validation and form data
</a></li>
1895 <li><a href=
"../dependencies/">Form node dependencies
</a></li>
1897 <div class=
"admonition warning">
1898 <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>
1900 <h2 id=
"abstractformbuilderform"><code>AbstractFormBuilderForm
</code><a class=
"headerlink" href=
"#abstractformbuilderform" title=
"Permanent link">#
</a></h2>
1901 <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>
1902 <p>In addition to the existing methods inherited by
<code>AbstractForm
</code>,
<code>AbstractFormBuilderForm
</code> provides the following methods:
</p>
1905 <p><code>buildForm()
</code> builds the form in the following steps:
</p>
1908 <p>Call
<code>AbtractFormBuilderForm::createForm()
</code> to create the
<code>IFormDocument
</code> object and add the form fields.
</p>
1910 <li>Call
<code>IFormDocument::build()
</code> to build the form.
</li>
1911 <li>Call
<code>AbtractFormBuilderForm::finalizeForm()
</code> to finalize the form like adding dependencies.
</li>
1913 <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.
1914 -
<code>createForm()
</code> creates the
<code>FormDocument
</code> object and sets the form mode.
1915 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.
1916 -
<code>finalizeForm()
</code> is called after the form has been built and the complete form hierarchy has been established.
1917 This method should be overridden to add dependencies, for example.
1918 -
<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.
1919 - If an object is edited, at the beginning of
<code>readData()
</code>,
<code>setFormObjectData()
</code> is called which calls
<code>IFormDocument::loadValuesFromObject()
</code>.
1920 If values need to be loaded from additional sources, this method should be used for that.
</p>
1921 <p><code>AbstractFormBuilderForm
</code> also provides the following (public) properties:
</p>
1923 <li><code>$form
</code> contains the
<code>IFormDocument
</code> object created in
<code>createForm()
</code>.
</li>
1924 <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>
1925 <li><code>$formObject
</code> contains the
<code>IStorableObject
</code> if the form is used to edit an existing object.
1926 For forms used to create objects,
<code>$formObject
</code> is always
<code>null
</code>.
1927 Edit forms have to manually identify the edited object based on the request data and set the value of
<code>$formObject
</code>.
</li>
1928 <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>
1929 <li><code>$objectActionClass
</code> is the name of the database object action class that is used to create or update the database object.
</li>
1931 <h2 id=
"dialogformdocument"><code>DialogFormDocument
</code><a class=
"headerlink" href=
"#dialogformdocument" title=
"Permanent link">#
</a></h2>
1932 <p>Form builder forms can also be used in dialogs.
1933 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.
1934 If a dialog form can be canceled, a cancel button is added.
</p>
1935 <p>If the dialog form is fetched via an AJAX request,
<code>IFormDocument::ajax()
</code> has to be called.
1936 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.
1937 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>
1938 <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.
1939 The constructor of
<code>FormBuilderDialog
</code> expects the following parameters:
</p>
1941 <li><code>dialogId
</code>: id of the dialog element
</li>
1942 <li><code>className
</code>: PHP class used to get the form dialog (and save the data if
<code>options.submitActionName
</code> is set)
</li>
1943 <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>
1944 <li><code>options
</code>: additional options:
</li>
1945 <li><code>actionParameters
</code> (default: empty): additional parameters sent during AJAX requests
</li>
1946 <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>
1947 <li><code>dialog
</code>: additional dialog options used as
<code>options
</code> during dialog setup
</li>
1948 <li><code>onSubmit
</code>: callback when the form is submitted (takes precedence over
<code>submitActionName
</code>)
</li>
1949 <li><code>submitActionName
</code> (default: not set): name of the action/method of
<code>className
</code> called when the form is submitted
</li>
1951 <p>The three public functions of
<code>FormBuilderDialog
</code> are:
</p>
1953 <li><code>destroy()
</code> destroys the dialog, the form, and all of the form fields.
</li>
1954 <li><code>getData()
</code> returns a Promise that returns the form data.
</li>
1955 <li><code>open()
</code> opens the dialog.
</li>
1958 <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>
1959 <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>
1960 <span class=
"s1">'testDialog
'</span><span class=
"p">,
</span>
1961 <span class=
"s1">'wcf\\data\\test\\TestAction
'</span><span class=
"p">,
</span>
1962 <span class=
"s1">'getDialog
'</span><span class=
"p">,
</span>
1963 <span class=
"p">{
</span>
1964 <span class=
"nx">destroyOnClose
</span><span class=
"o">:
</span> <span class=
"kc">true
</span><span class=
"p">,
</span>
1965 <span class=
"nx">dialog
</span><span class=
"o">:
</span> <span class=
"p">{
</span>
1966 <span class=
"nx">title
</span><span class=
"o">:
</span> <span class=
"s1">'Test Dialog
'</span>
1967 <span class=
"p">},
</span>
1968 <span class=
"nx">submitActionName
</span><span class=
"o">:
</span> <span class=
"s1">'saveDialog
'</span>
1969 <span class=
"p">}
</span>
1970 <span class=
"p">);
</span>
1972 <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>
1973 <span class=
"nx">dialog
</span><span class=
"p">.
</span><span class=
"nx">open
</span><span class=
"p">();
</span>
1974 <span class=
"p">});
</span>
1975 <span class=
"p">});
</span>
1982 <div class=
"md-source-date">
1985 Last update:
2021-
01-
15
2003 <footer class=
"md-footer">
2005 <nav class=
"md-footer__inner md-grid" aria-label=
"Footer">
2007 <a href=
"../../events/" class=
"md-footer__link md-footer__link--prev" rel=
"prev">
2008 <div class=
"md-footer__button md-icon">
2009 <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>
2011 <div class=
"md-footer__title">
2012 <div class=
"md-ellipsis">
2013 <span class=
"md-footer__direction">
2022 <a href=
"../structure/" class=
"md-footer__link md-footer__link--next" rel=
"next">
2023 <div class=
"md-footer__title">
2024 <div class=
"md-ellipsis">
2025 <span class=
"md-footer__direction">
2031 <div class=
"md-footer__button md-icon">
2032 <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>
2038 <div class=
"md-footer-meta md-typeset">
2039 <div class=
"md-footer-meta__inner md-grid">
2040 <div class=
"md-footer-copyright">
2042 <div class=
"md-footer-copyright__highlight">
2043 Copyright ©
2020 WoltLab GmbH
2047 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
2052 <div class=
"md-footer-copyright">
2053 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
2054 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
2061 <div class=
"md-dialog" data-md-component=
"dialog">
2062 <div class=
"md-dialog__inner md-typeset"></div>
2064 <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.fb4a9340.min.js",
"version": {
"provider":
"mike"}}
</script>
2067 <script src=
"../../../../assets/javascripts/bundle.5cf3e710.min.js"></script>