3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
11 <link rel=
"canonical" href=
"https://docs.woltlab.com/6.0/getting-started/">
15 <link rel=
"next" href=
"../php/pages/">
17 <link rel=
"icon" href=
"../assets/default.favicon.ico">
18 <meta name=
"generator" content=
"mkdocs-1.4.2, mkdocs-material-9.1.5">
22 <title>Getting Started - WoltLab Suite Documentation
</title>
26 <link rel=
"stylesheet" href=
"../assets/stylesheets/main.7a7fce14.min.css">
29 <link rel=
"stylesheet" href=
"../assets/stylesheets/palette.a0c5b2b5.min.css">
39 <link rel=
"stylesheet" href=
"../stylesheets/extra.css">
41 <script>__md_scope=new URL(
"..",location),__md_hash=e=
>[...e].reduce((e,_)=
>(e<
<5)-e+_.charCodeAt(
0),
0),__md_get=(e,_=localStorage,t=__md_scope)=
>JSON.parse(_.getItem(t.pathname+
"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=
>{try{t.setItem(a.pathname+
"."+e,JSON.stringify(_))}catch(e){}}
</script>
56 <body dir=
"ltr" data-md-color-scheme=
"default" data-md-color-primary=
"teal" data-md-color-accent=
"">
60 <input class=
"md-toggle" data-md-toggle=
"drawer" type=
"checkbox" id=
"__drawer" autocomplete=
"off">
61 <input class=
"md-toggle" data-md-toggle=
"search" type=
"checkbox" id=
"__search" autocomplete=
"off">
62 <label class=
"md-overlay" for=
"__drawer"></label>
63 <div data-md-component=
"skip">
66 <a href=
"#creating-a-simple-package" class=
"md-skip">
71 <div data-md-component=
"announce">
73 <aside class=
"md-banner">
74 <div class=
"md-banner__inner md-grid md-typeset">
77 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
85 <div data-md-color-scheme=
"default" data-md-component=
"outdated" hidden
>
94 <header class=
"md-header md-header--shadow" data-md-component=
"header">
95 <nav class=
"md-header__inner md-grid" aria-label=
"Header">
96 <a href=
".." title=
"WoltLab Suite Documentation" class=
"md-header__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
98 <img src=
"../assets/logo.png" alt=
"logo">
101 <label class=
"md-header__button md-icon" for=
"__drawer">
102 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2Z"/></svg>
104 <div class=
"md-header__title" data-md-component=
"header-title">
105 <div class=
"md-header__ellipsis">
106 <div class=
"md-header__topic">
107 <span class=
"md-ellipsis">
108 WoltLab Suite Documentation
111 <div class=
"md-header__topic" data-md-component=
"header-topic">
112 <span class=
"md-ellipsis">
123 <label class=
"md-header__button md-icon" for=
"__search">
124 <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>
126 <div class=
"md-search" data-md-component=
"search" role=
"dialog">
127 <label class=
"md-search__overlay" for=
"__search"></label>
128 <div class=
"md-search__inner" role=
"search">
129 <form class=
"md-search__form" name=
"search">
130 <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" required
>
131 <label class=
"md-search__icon md-icon" for=
"__search">
132 <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>
133 <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>
135 <nav class=
"md-search__options" aria-label=
"Search">
137 <button type=
"reset" class=
"md-search__icon md-icon" title=
"Clear" aria-label=
"Clear" tabindex=
"-1">
138 <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>
143 <div class=
"md-search__output">
144 <div class=
"md-search__scrollwrap" data-md-scrollfix
>
145 <div class=
"md-search-result" data-md-component=
"search-result">
146 <div class=
"md-search-result__meta">
149 <ol class=
"md-search-result__list" role=
"presentation"></ol>
157 <div class=
"md-header__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"><!--! Font Awesome Free 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><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>
163 <div class=
"md-source__repository">
173 <div class=
"md-container" data-md-component=
"container">
180 <main class=
"md-main" data-md-component=
"main">
181 <div class=
"md-main__inner md-grid">
185 <div class=
"md-sidebar md-sidebar--primary" data-md-component=
"sidebar" data-md-type=
"navigation" >
186 <div class=
"md-sidebar__scrollwrap">
187 <div class=
"md-sidebar__inner">
191 <nav class=
"md-nav md-nav--primary" aria-label=
"Navigation" data-md-level=
"0">
192 <label class=
"md-nav__title" for=
"__drawer">
193 <a href=
".." title=
"WoltLab Suite Documentation" class=
"md-nav__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
195 <img src=
"../assets/logo.png" alt=
"logo">
198 WoltLab Suite Documentation
201 <div class=
"md-nav__source">
202 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
203 <div class=
"md-source__icon md-icon">
205 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><!--! Font Awesome Free 6.3.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) Copyright 2023 Fonticons, Inc.--><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>
207 <div class=
"md-source__repository">
213 <ul class=
"md-nav__list" data-md-scrollfix
>
224 <li class=
"md-nav__item md-nav__item--active">
226 <input class=
"md-nav__toggle md-toggle" type=
"checkbox" id=
"__toc">
232 <label class=
"md-nav__link md-nav__link--active" for=
"__toc">
234 <span class=
"md-nav__icon md-icon"></span>
237 <a href=
"./" class=
"md-nav__link md-nav__link--active">
243 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
250 <label class=
"md-nav__title" for=
"__toc">
251 <span class=
"md-nav__icon md-icon"></span>
254 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
256 <li class=
"md-nav__item">
257 <a href=
"#setup-and-requirements" class=
"md-nav__link">
258 Setup and Requirements
263 <li class=
"md-nav__item">
264 <a href=
"#the-packagexml-file" class=
"md-nav__link">
270 <li class=
"md-nav__item">
271 <a href=
"#the-php-class" class=
"md-nav__link">
277 <li class=
"md-nav__item">
278 <a href=
"#the-template" class=
"md-nav__link">
284 <li class=
"md-nav__item">
285 <a href=
"#the-page-definition" class=
"md-nav__link">
291 <li class=
"md-nav__item">
292 <a href=
"#building-the-package" class=
"md-nav__link">
298 <li class=
"md-nav__item">
299 <a href=
"#installation" class=
"md-nav__link">
305 <li class=
"md-nav__item">
306 <a href=
"#developer-tools" class=
"md-nav__link">
310 <nav class=
"md-nav" aria-label=
"Developer Tools">
311 <ul class=
"md-nav__list">
313 <li class=
"md-nav__item">
314 <a href=
"#registering-a-project" class=
"md-nav__link">
315 Registering a Project
320 <li class=
"md-nav__item">
321 <a href=
"#synchronizing" class=
"md-nav__link">
332 <li class=
"md-nav__item">
333 <a href=
"#appendix" class=
"md-nav__link">
337 <nav class=
"md-nav" aria-label=
"Appendix">
338 <ul class=
"md-nav__list">
340 <li class=
"md-nav__item">
341 <a href=
"#template-guessing" class=
"md-nav__link">
368 <li class=
"md-nav__item md-nav__item--nested">
373 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_2" >
377 <label class=
"md-nav__link" for=
"__nav_2" id=
"__nav_2_label" tabindex=
"0">
379 <span class=
"md-nav__icon md-icon"></span>
382 <nav class=
"md-nav" data-md-level=
"1" aria-labelledby=
"__nav_2_label" aria-expanded=
"false">
383 <label class=
"md-nav__title" for=
"__nav_2">
384 <span class=
"md-nav__icon md-icon"></span>
387 <ul class=
"md-nav__list" data-md-scrollfix
>
394 <li class=
"md-nav__item">
395 <a href=
"../php/pages/" class=
"md-nav__link">
408 <li class=
"md-nav__item">
409 <a href=
"../php/database-objects/" class=
"md-nav__link">
422 <li class=
"md-nav__item">
423 <a href=
"../php/database-access/" class=
"md-nav__link">
436 <li class=
"md-nav__item">
437 <a href=
"../php/exceptions/" class=
"md-nav__link">
451 <li class=
"md-nav__item md-nav__item--nested">
456 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_2_5" >
460 <label class=
"md-nav__link" for=
"__nav_2_5" id=
"__nav_2_5_label" tabindex=
"0">
462 <span class=
"md-nav__icon md-icon"></span>
465 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_2_5_label" aria-expanded=
"false">
466 <label class=
"md-nav__title" for=
"__nav_2_5">
467 <span class=
"md-nav__icon md-icon"></span>
470 <ul class=
"md-nav__list" data-md-scrollfix
>
478 <li class=
"md-nav__item md-nav__item--nested">
483 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_2_5_1" >
487 <label class=
"md-nav__link" for=
"__nav_2_5_1" id=
"__nav_2_5_1_label" tabindex=
"0">
489 <span class=
"md-nav__icon md-icon"></span>
492 <nav class=
"md-nav" data-md-level=
"3" aria-labelledby=
"__nav_2_5_1_label" aria-expanded=
"false">
493 <label class=
"md-nav__title" for=
"__nav_2_5_1">
494 <span class=
"md-nav__icon md-icon"></span>
497 <ul class=
"md-nav__list" data-md-scrollfix
>
504 <li class=
"md-nav__item">
505 <a href=
"../php/api/caches/" class=
"md-nav__link">
518 <li class=
"md-nav__item">
519 <a href=
"../php/api/caches_persistent-caches/" class=
"md-nav__link">
532 <li class=
"md-nav__item">
533 <a href=
"../php/api/caches_runtime-caches/" class=
"md-nav__link">
553 <li class=
"md-nav__item">
554 <a href=
"../php/api/comments/" class=
"md-nav__link">
567 <li class=
"md-nav__item">
568 <a href=
"../php/api/cronjobs/" class=
"md-nav__link">
581 <li class=
"md-nav__item">
582 <a href=
"../php/api/events/" class=
"md-nav__link">
596 <li class=
"md-nav__item md-nav__item--nested">
601 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_2_5_5" >
605 <label class=
"md-nav__link" for=
"__nav_2_5_5" id=
"__nav_2_5_5_label" tabindex=
"0">
607 <span class=
"md-nav__icon md-icon"></span>
610 <nav class=
"md-nav" data-md-level=
"3" aria-labelledby=
"__nav_2_5_5_label" aria-expanded=
"false">
611 <label class=
"md-nav__title" for=
"__nav_2_5_5">
612 <span class=
"md-nav__icon md-icon"></span>
615 <ul class=
"md-nav__list" data-md-scrollfix
>
622 <li class=
"md-nav__item">
623 <a href=
"../php/api/form_builder/overview/" class=
"md-nav__link">
636 <li class=
"md-nav__item">
637 <a href=
"../php/api/form_builder/structure/" class=
"md-nav__link">
650 <li class=
"md-nav__item">
651 <a href=
"../php/api/form_builder/form_fields/" class=
"md-nav__link">
664 <li class=
"md-nav__item">
665 <a href=
"../php/api/form_builder/validation_data/" class=
"md-nav__link">
678 <li class=
"md-nav__item">
679 <a href=
"../php/api/form_builder/dependencies/" class=
"md-nav__link">
699 <li class=
"md-nav__item">
700 <a href=
"../php/api/package_installation_plugins/" class=
"md-nav__link">
701 Package Installation Plugins
713 <li class=
"md-nav__item">
714 <a href=
"../php/api/user_activity_points/" class=
"md-nav__link">
727 <li class=
"md-nav__item">
728 <a href=
"../php/api/user_notifications/" class=
"md-nav__link">
741 <li class=
"md-nav__item">
742 <a href=
"../php/api/sitemaps/" class=
"md-nav__link">
762 <li class=
"md-nav__item">
763 <a href=
"../php/code-style/" class=
"md-nav__link">
776 <li class=
"md-nav__item">
777 <a href=
"../php/apps/" class=
"md-nav__link">
790 <li class=
"md-nav__item">
791 <a href=
"../php/gdpr/" class=
"md-nav__link">
813 <li class=
"md-nav__item md-nav__item--nested">
818 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_3" >
822 <label class=
"md-nav__link" for=
"__nav_3" id=
"__nav_3_label" tabindex=
"0">
823 Languages, Templates & CSS
824 <span class=
"md-nav__icon md-icon"></span>
827 <nav class=
"md-nav" data-md-level=
"1" aria-labelledby=
"__nav_3_label" aria-expanded=
"false">
828 <label class=
"md-nav__title" for=
"__nav_3">
829 <span class=
"md-nav__icon md-icon"></span>
830 Languages, Templates & CSS
832 <ul class=
"md-nav__list" data-md-scrollfix
>
839 <li class=
"md-nav__item">
840 <a href=
"../view/languages/" class=
"md-nav__link">
853 <li class=
"md-nav__item">
854 <a href=
"../view/templates/" class=
"md-nav__link">
867 <li class=
"md-nav__item">
868 <a href=
"../view/template-plugins/" class=
"md-nav__link">
881 <li class=
"md-nav__item">
882 <a href=
"../view/css/" class=
"md-nav__link">
904 <li class=
"md-nav__item md-nav__item--nested">
909 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_4" >
913 <label class=
"md-nav__link" for=
"__nav_4" id=
"__nav_4_label" tabindex=
"0">
914 TypeScript and JavaScript API
915 <span class=
"md-nav__icon md-icon"></span>
918 <nav class=
"md-nav" data-md-level=
"1" aria-labelledby=
"__nav_4_label" aria-expanded=
"false">
919 <label class=
"md-nav__title" for=
"__nav_4">
920 <span class=
"md-nav__icon md-icon"></span>
921 TypeScript and JavaScript API
923 <ul class=
"md-nav__list" data-md-scrollfix
>
930 <li class=
"md-nav__item">
931 <a href=
"../javascript/general-usage/" class=
"md-nav__link">
944 <li class=
"md-nav__item">
945 <a href=
"../javascript/typescript/" class=
"md-nav__link">
959 <li class=
"md-nav__item md-nav__item--nested">
964 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_4_3" >
968 <label class=
"md-nav__link" for=
"__nav_4_3" id=
"__nav_4_3_label" tabindex=
"0">
970 <span class=
"md-nav__icon md-icon"></span>
973 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_4_3_label" aria-expanded=
"false">
974 <label class=
"md-nav__title" for=
"__nav_4_3">
975 <span class=
"md-nav__icon md-icon"></span>
978 <ul class=
"md-nav__list" data-md-scrollfix
>
985 <li class=
"md-nav__item">
986 <a href=
"../javascript/components_confirmation/" class=
"md-nav__link">
999 <li class=
"md-nav__item">
1000 <a href=
"../javascript/components_dialog/" class=
"md-nav__link">
1013 <li class=
"md-nav__item">
1014 <a href=
"../javascript/components_google_maps/" class=
"md-nav__link">
1027 <li class=
"md-nav__item">
1028 <a href=
"../javascript/components_pagination/" class=
"md-nav__link">
1049 <li class=
"md-nav__item md-nav__item--nested">
1054 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_4_4" >
1058 <label class=
"md-nav__link" for=
"__nav_4_4" id=
"__nav_4_4_label" tabindex=
"0">
1060 <span class=
"md-nav__icon md-icon"></span>
1063 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_4_4_label" aria-expanded=
"false">
1064 <label class=
"md-nav__title" for=
"__nav_4_4">
1065 <span class=
"md-nav__icon md-icon"></span>
1068 <ul class=
"md-nav__list" data-md-scrollfix
>
1075 <li class=
"md-nav__item">
1076 <a href=
"../javascript/new-api_writing-a-module/" class=
"md-nav__link">
1089 <li class=
"md-nav__item">
1090 <a href=
"../javascript/new-api_core/" class=
"md-nav__link">
1103 <li class=
"md-nav__item">
1104 <a href=
"../javascript/new-api_dom/" class=
"md-nav__link">
1117 <li class=
"md-nav__item">
1118 <a href=
"../javascript/new-api_events/" class=
"md-nav__link">
1131 <li class=
"md-nav__item">
1132 <a href=
"../javascript/new-api_ajax/" class=
"md-nav__link">
1145 <li class=
"md-nav__item">
1146 <a href=
"../javascript/new-api_dialogs/" class=
"md-nav__link">
1159 <li class=
"md-nav__item">
1160 <a href=
"../javascript/new-api_browser/" class=
"md-nav__link">
1161 Browser and Screen Sizes
1173 <li class=
"md-nav__item">
1174 <a href=
"../javascript/new-api_ui/" class=
"md-nav__link">
1194 <li class=
"md-nav__item">
1195 <a href=
"../javascript/legacy-api/" class=
"md-nav__link">
1208 <li class=
"md-nav__item">
1209 <a href=
"../javascript/code-snippets/" class=
"md-nav__link">
1231 <li class=
"md-nav__item md-nav__item--nested">
1236 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_5" >
1240 <label class=
"md-nav__link" for=
"__nav_5" id=
"__nav_5_label" tabindex=
"0">
1242 <span class=
"md-nav__icon md-icon"></span>
1245 <nav class=
"md-nav" data-md-level=
"1" aria-labelledby=
"__nav_5_label" aria-expanded=
"false">
1246 <label class=
"md-nav__title" for=
"__nav_5">
1247 <span class=
"md-nav__icon md-icon"></span>
1250 <ul class=
"md-nav__list" data-md-scrollfix
>
1257 <li class=
"md-nav__item">
1258 <a href=
"../package/package-xml/" class=
"md-nav__link">
1272 <li class=
"md-nav__item md-nav__item--nested">
1277 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_5_2" >
1281 <label class=
"md-nav__link" for=
"__nav_5_2" id=
"__nav_5_2_label" tabindex=
"0">
1283 <span class=
"md-nav__icon md-icon"></span>
1286 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_5_2_label" aria-expanded=
"false">
1287 <label class=
"md-nav__title" for=
"__nav_5_2">
1288 <span class=
"md-nav__icon md-icon"></span>
1291 <ul class=
"md-nav__list" data-md-scrollfix
>
1298 <li class=
"md-nav__item">
1299 <a href=
"../package/pip/" class=
"md-nav__link">
1312 <li class=
"md-nav__item">
1313 <a href=
"../package/pip/acl-option/" class=
"md-nav__link">
1326 <li class=
"md-nav__item">
1327 <a href=
"../package/pip/acp-menu/" class=
"md-nav__link">
1340 <li class=
"md-nav__item">
1341 <a href=
"../package/pip/acp-search-provider/" class=
"md-nav__link">
1354 <li class=
"md-nav__item">
1355 <a href=
"../package/pip/acp-template/" class=
"md-nav__link">
1368 <li class=
"md-nav__item">
1369 <a href=
"../package/pip/acp-template-delete/" class=
"md-nav__link">
1382 <li class=
"md-nav__item">
1383 <a href=
"../package/pip/bbcode/" class=
"md-nav__link">
1396 <li class=
"md-nav__item">
1397 <a href=
"../package/pip/box/" class=
"md-nav__link">
1410 <li class=
"md-nav__item">
1411 <a href=
"../package/pip/clipboard-action/" class=
"md-nav__link">
1424 <li class=
"md-nav__item">
1425 <a href=
"../package/pip/core-object/" class=
"md-nav__link">
1438 <li class=
"md-nav__item">
1439 <a href=
"../package/pip/cronjob/" class=
"md-nav__link">
1452 <li class=
"md-nav__item">
1453 <a href=
"../package/pip/database/" class=
"md-nav__link">
1466 <li class=
"md-nav__item">
1467 <a href=
"../package/pip/event-listener/" class=
"md-nav__link">
1480 <li class=
"md-nav__item">
1481 <a href=
"../package/pip/file/" class=
"md-nav__link">
1494 <li class=
"md-nav__item">
1495 <a href=
"../package/pip/file-delete/" class=
"md-nav__link">
1508 <li class=
"md-nav__item">
1509 <a href=
"../package/pip/language/" class=
"md-nav__link">
1522 <li class=
"md-nav__item">
1523 <a href=
"../package/pip/media-provider/" class=
"md-nav__link">
1536 <li class=
"md-nav__item">
1537 <a href=
"../package/pip/menu/" class=
"md-nav__link">
1550 <li class=
"md-nav__item">
1551 <a href=
"../package/pip/menu-item/" class=
"md-nav__link">
1564 <li class=
"md-nav__item">
1565 <a href=
"../package/pip/object-type/" class=
"md-nav__link">
1578 <li class=
"md-nav__item">
1579 <a href=
"../package/pip/object-type-definition/" class=
"md-nav__link">
1580 objectTypeDefinition
1592 <li class=
"md-nav__item">
1593 <a href=
"../package/pip/option/" class=
"md-nav__link">
1606 <li class=
"md-nav__item">
1607 <a href=
"../package/pip/page/" class=
"md-nav__link">
1620 <li class=
"md-nav__item">
1621 <a href=
"../package/pip/pip/" class=
"md-nav__link">
1634 <li class=
"md-nav__item">
1635 <a href=
"../package/pip/script/" class=
"md-nav__link">
1648 <li class=
"md-nav__item">
1649 <a href=
"../package/pip/smiley/" class=
"md-nav__link">
1662 <li class=
"md-nav__item">
1663 <a href=
"../package/pip/sql/" class=
"md-nav__link">
1676 <li class=
"md-nav__item">
1677 <a href=
"../package/pip/style/" class=
"md-nav__link">
1690 <li class=
"md-nav__item">
1691 <a href=
"../package/pip/template/" class=
"md-nav__link">
1704 <li class=
"md-nav__item">
1705 <a href=
"../package/pip/template-delete/" class=
"md-nav__link">
1718 <li class=
"md-nav__item">
1719 <a href=
"../package/pip/template-listener/" class=
"md-nav__link">
1732 <li class=
"md-nav__item">
1733 <a href=
"../package/pip/user-group-option/" class=
"md-nav__link">
1746 <li class=
"md-nav__item">
1747 <a href=
"../package/pip/user-menu/" class=
"md-nav__link">
1760 <li class=
"md-nav__item">
1761 <a href=
"../package/pip/user-notification-event/" class=
"md-nav__link">
1762 userNotificationEvent
1774 <li class=
"md-nav__item">
1775 <a href=
"../package/pip/user-option/" class=
"md-nav__link">
1788 <li class=
"md-nav__item">
1789 <a href=
"../package/pip/user-profile-menu/" class=
"md-nav__link">
1809 <li class=
"md-nav__item">
1810 <a href=
"../package/database-php-api/" class=
"md-nav__link">
1832 <li class=
"md-nav__item md-nav__item--nested">
1837 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6" >
1841 <label class=
"md-nav__link" for=
"__nav_6" id=
"__nav_6_label" tabindex=
"0">
1843 <span class=
"md-nav__icon md-icon"></span>
1846 <nav class=
"md-nav" data-md-level=
"1" aria-labelledby=
"__nav_6_label" aria-expanded=
"false">
1847 <label class=
"md-nav__title" for=
"__nav_6">
1848 <span class=
"md-nav__icon md-icon"></span>
1851 <ul class=
"md-nav__list" data-md-scrollfix
>
1859 <li class=
"md-nav__item md-nav__item--nested">
1864 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6_1" >
1868 <label class=
"md-nav__link" for=
"__nav_6_1" id=
"__nav_6_1_label" tabindex=
"0">
1869 From WoltLab Suite
5.5
1870 <span class=
"md-nav__icon md-icon"></span>
1873 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_6_1_label" aria-expanded=
"false">
1874 <label class=
"md-nav__title" for=
"__nav_6_1">
1875 <span class=
"md-nav__icon md-icon"></span>
1876 From WoltLab Suite
5.5
1878 <ul class=
"md-nav__list" data-md-scrollfix
>
1885 <li class=
"md-nav__item">
1886 <a href=
"../migration/wsc55/php/" class=
"md-nav__link">
1899 <li class=
"md-nav__item">
1900 <a href=
"../migration/wsc55/javascript/" class=
"md-nav__link">
1901 TypeScript and JavaScript
1913 <li class=
"md-nav__item">
1914 <a href=
"../migration/wsc55/templates/" class=
"md-nav__link">
1927 <li class=
"md-nav__item">
1928 <a href=
"../migration/wsc55/icons/" class=
"md-nav__link">
1941 <li class=
"md-nav__item">
1942 <a href=
"../migration/wsc55/dialogs/" class=
"md-nav__link">
1955 <li class=
"md-nav__item">
1956 <a href=
"../migration/wsc55/libraries/" class=
"md-nav__link">
1957 Third Party Libraries
1969 <li class=
"md-nav__item">
1970 <a href=
"../migration/wsc55/deprecations_removals/" class=
"md-nav__link">
1971 Deprecations and Removals
1991 <li class=
"md-nav__item md-nav__item--nested">
1996 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6_2" >
2000 <label class=
"md-nav__link" for=
"__nav_6_2" id=
"__nav_6_2_label" tabindex=
"0">
2001 From WoltLab Suite
5.4
2002 <span class=
"md-nav__icon md-icon"></span>
2005 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_6_2_label" aria-expanded=
"false">
2006 <label class=
"md-nav__title" for=
"__nav_6_2">
2007 <span class=
"md-nav__icon md-icon"></span>
2008 From WoltLab Suite
5.4
2010 <ul class=
"md-nav__list" data-md-scrollfix
>
2017 <li class=
"md-nav__item">
2018 <a href=
"../migration/wsc54/php/" class=
"md-nav__link">
2031 <li class=
"md-nav__item">
2032 <a href=
"../migration/wsc54/javascript/" class=
"md-nav__link">
2033 TypeScript and JavaScript
2045 <li class=
"md-nav__item">
2046 <a href=
"../migration/wsc54/templates/" class=
"md-nav__link">
2059 <li class=
"md-nav__item">
2060 <a href=
"../migration/wsc54/libraries/" class=
"md-nav__link">
2061 Third Party Libraries
2073 <li class=
"md-nav__item">
2074 <a href=
"../migration/wsc54/deprecations_removals/" class=
"md-nav__link">
2075 Deprecations and Removals
2095 <li class=
"md-nav__item md-nav__item--nested">
2100 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6_3" >
2104 <label class=
"md-nav__link" for=
"__nav_6_3" id=
"__nav_6_3_label" tabindex=
"0">
2105 From WoltLab Suite
5.3
2106 <span class=
"md-nav__icon md-icon"></span>
2109 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_6_3_label" aria-expanded=
"false">
2110 <label class=
"md-nav__title" for=
"__nav_6_3">
2111 <span class=
"md-nav__icon md-icon"></span>
2112 From WoltLab Suite
5.3
2114 <ul class=
"md-nav__list" data-md-scrollfix
>
2121 <li class=
"md-nav__item">
2122 <a href=
"../migration/wsc53/php/" class=
"md-nav__link">
2135 <li class=
"md-nav__item">
2136 <a href=
"../migration/wsc53/session/" class=
"md-nav__link">
2137 Session Handling and Authentication
2149 <li class=
"md-nav__item">
2150 <a href=
"../migration/wsc53/javascript/" class=
"md-nav__link">
2151 TypeScript and JavaScript
2163 <li class=
"md-nav__item">
2164 <a href=
"../migration/wsc53/templates/" class=
"md-nav__link">
2177 <li class=
"md-nav__item">
2178 <a href=
"../migration/wsc53/libraries/" class=
"md-nav__link">
2179 Third Party Libraries
2199 <li class=
"md-nav__item md-nav__item--nested">
2204 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6_4" >
2208 <label class=
"md-nav__link" for=
"__nav_6_4" id=
"__nav_6_4_label" tabindex=
"0">
2209 From WoltLab Suite
5.2
2210 <span class=
"md-nav__icon md-icon"></span>
2213 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_6_4_label" aria-expanded=
"false">
2214 <label class=
"md-nav__title" for=
"__nav_6_4">
2215 <span class=
"md-nav__icon md-icon"></span>
2216 From WoltLab Suite
5.2
2218 <ul class=
"md-nav__list" data-md-scrollfix
>
2225 <li class=
"md-nav__item">
2226 <a href=
"../migration/wsc52/php/" class=
"md-nav__link">
2239 <li class=
"md-nav__item">
2240 <a href=
"../migration/wsc52/templates/" class=
"md-nav__link">
2241 Templates and Languages
2253 <li class=
"md-nav__item">
2254 <a href=
"../migration/wsc52/libraries/" class=
"md-nav__link">
2255 Third Party Libraries
2275 <li class=
"md-nav__item md-nav__item--nested">
2280 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6_5" >
2284 <label class=
"md-nav__link" for=
"__nav_6_5" id=
"__nav_6_5_label" tabindex=
"0">
2285 From WoltLab Suite
3.1
2286 <span class=
"md-nav__icon md-icon"></span>
2289 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_6_5_label" aria-expanded=
"false">
2290 <label class=
"md-nav__title" for=
"__nav_6_5">
2291 <span class=
"md-nav__icon md-icon"></span>
2292 From WoltLab Suite
3.1
2294 <ul class=
"md-nav__list" data-md-scrollfix
>
2301 <li class=
"md-nav__item">
2302 <a href=
"../migration/wsc31/php/" class=
"md-nav__link">
2323 <li class=
"md-nav__item md-nav__item--nested">
2328 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6_6" >
2332 <label class=
"md-nav__link" for=
"__nav_6_6" id=
"__nav_6_6_label" tabindex=
"0">
2333 From WoltLab Suite
3.0
2334 <span class=
"md-nav__icon md-icon"></span>
2337 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_6_6_label" aria-expanded=
"false">
2338 <label class=
"md-nav__title" for=
"__nav_6_6">
2339 <span class=
"md-nav__icon md-icon"></span>
2340 From WoltLab Suite
3.0
2342 <ul class=
"md-nav__list" data-md-scrollfix
>
2349 <li class=
"md-nav__item">
2350 <a href=
"../migration/wsc30/php/" class=
"md-nav__link">
2363 <li class=
"md-nav__item">
2364 <a href=
"../migration/wsc30/javascript/" class=
"md-nav__link">
2377 <li class=
"md-nav__item">
2378 <a href=
"../migration/wsc30/templates/" class=
"md-nav__link">
2391 <li class=
"md-nav__item">
2392 <a href=
"../migration/wsc30/css/" class=
"md-nav__link">
2405 <li class=
"md-nav__item">
2406 <a href=
"../migration/wsc30/package/" class=
"md-nav__link">
2427 <li class=
"md-nav__item md-nav__item--nested">
2432 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_6_7" >
2436 <label class=
"md-nav__link" for=
"__nav_6_7" id=
"__nav_6_7_label" tabindex=
"0">
2438 <span class=
"md-nav__icon md-icon"></span>
2441 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_6_7_label" aria-expanded=
"false">
2442 <label class=
"md-nav__title" for=
"__nav_6_7">
2443 <span class=
"md-nav__icon md-icon"></span>
2446 <ul class=
"md-nav__list" data-md-scrollfix
>
2453 <li class=
"md-nav__item">
2454 <a href=
"../migration/wcf21/php/" class=
"md-nav__link">
2467 <li class=
"md-nav__item">
2468 <a href=
"../migration/wcf21/templates/" class=
"md-nav__link">
2481 <li class=
"md-nav__item">
2482 <a href=
"../migration/wcf21/css/" class=
"md-nav__link">
2495 <li class=
"md-nav__item">
2496 <a href=
"../migration/wcf21/package/" class=
"md-nav__link">
2525 <li class=
"md-nav__item md-nav__item--nested">
2530 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_7" >
2534 <label class=
"md-nav__link" for=
"__nav_7" id=
"__nav_7_label" tabindex=
"0">
2536 <span class=
"md-nav__icon md-icon"></span>
2539 <nav class=
"md-nav" data-md-level=
"1" aria-labelledby=
"__nav_7_label" aria-expanded=
"false">
2540 <label class=
"md-nav__title" for=
"__nav_7">
2541 <span class=
"md-nav__icon md-icon"></span>
2544 <ul class=
"md-nav__list" data-md-scrollfix
>
2552 <li class=
"md-nav__item md-nav__item--nested">
2557 <input class=
"md-nav__toggle md-toggle " type=
"checkbox" id=
"__nav_7_1" >
2561 <label class=
"md-nav__link" for=
"__nav_7_1" id=
"__nav_7_1_label" tabindex=
"0">
2563 <span class=
"md-nav__icon md-icon"></span>
2566 <nav class=
"md-nav" data-md-level=
"2" aria-labelledby=
"__nav_7_1_label" aria-expanded=
"false">
2567 <label class=
"md-nav__title" for=
"__nav_7_1">
2568 <span class=
"md-nav__icon md-icon"></span>
2571 <ul class=
"md-nav__list" data-md-scrollfix
>
2578 <li class=
"md-nav__item">
2579 <a href=
"../tutorial/series/overview/" class=
"md-nav__link">
2592 <li class=
"md-nav__item">
2593 <a href=
"../tutorial/series/part_1/" class=
"md-nav__link">
2606 <li class=
"md-nav__item">
2607 <a href=
"../tutorial/series/part_2/" class=
"md-nav__link">
2620 <li class=
"md-nav__item">
2621 <a href=
"../tutorial/series/part_3/" class=
"md-nav__link">
2634 <li class=
"md-nav__item">
2635 <a href=
"../tutorial/series/part_4/" class=
"md-nav__link">
2648 <li class=
"md-nav__item">
2649 <a href=
"../tutorial/series/part_5/" class=
"md-nav__link">
2662 <li class=
"md-nav__item">
2663 <a href=
"../tutorial/series/part_6/" class=
"md-nav__link">
2692 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
2693 <div class=
"md-sidebar__scrollwrap">
2694 <div class=
"md-sidebar__inner">
2697 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
2704 <label class=
"md-nav__title" for=
"__toc">
2705 <span class=
"md-nav__icon md-icon"></span>
2708 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
2710 <li class=
"md-nav__item">
2711 <a href=
"#setup-and-requirements" class=
"md-nav__link">
2712 Setup and Requirements
2717 <li class=
"md-nav__item">
2718 <a href=
"#the-packagexml-file" class=
"md-nav__link">
2719 The package.xml File
2724 <li class=
"md-nav__item">
2725 <a href=
"#the-php-class" class=
"md-nav__link">
2731 <li class=
"md-nav__item">
2732 <a href=
"#the-template" class=
"md-nav__link">
2738 <li class=
"md-nav__item">
2739 <a href=
"#the-page-definition" class=
"md-nav__link">
2745 <li class=
"md-nav__item">
2746 <a href=
"#building-the-package" class=
"md-nav__link">
2747 Building the Package
2752 <li class=
"md-nav__item">
2753 <a href=
"#installation" class=
"md-nav__link">
2759 <li class=
"md-nav__item">
2760 <a href=
"#developer-tools" class=
"md-nav__link">
2764 <nav class=
"md-nav" aria-label=
"Developer Tools">
2765 <ul class=
"md-nav__list">
2767 <li class=
"md-nav__item">
2768 <a href=
"#registering-a-project" class=
"md-nav__link">
2769 Registering a Project
2774 <li class=
"md-nav__item">
2775 <a href=
"#synchronizing" class=
"md-nav__link">
2786 <li class=
"md-nav__item">
2787 <a href=
"#appendix" class=
"md-nav__link">
2791 <nav class=
"md-nav" aria-label=
"Appendix">
2792 <ul class=
"md-nav__list">
2794 <li class=
"md-nav__item">
2795 <a href=
"#template-guessing" class=
"md-nav__link">
2815 <div class=
"md-content" data-md-component=
"content">
2816 <article class=
"md-content__inner md-typeset">
2824 <h1 id=
"creating-a-simple-package">Creating a simple package
<a class=
"headerlink" href=
"#creating-a-simple-package" title=
"Permanent link">#
</a></h1>
2825 <h2 id=
"setup-and-requirements">Setup and Requirements
<a class=
"headerlink" href=
"#setup-and-requirements" title=
"Permanent link">#
</a></h2>
2826 <p>This guide will help you to create a simple package that provides a simple test
2827 page. It is nothing too fancy, but you can use it as the foundation for your
2829 <p>There are some requirements you should met before starting:
</p>
2831 <li>Text editor with syntax highlighting for PHP,
<a href=
"https://notepad-plus-plus.org/">Notepad++
</a> is a solid pick
</li>
2832 <li><code>*.php
</code> and
<code>*.tpl
</code> should be encoded with ANSI/ASCII
</li>
2833 <li><code>*.xml
</code> are always encoded with UTF-
8, but omit the BOM (byte-order-mark)
</li>
2834 <li>Use tabs instead of spaces to indent lines
</li>
2835 <li>It is recommended to set the tab width to
<code>8</code> spaces, this is used in the entire software and will ease reading the source files
</li>
2836 <li>An active installation of WoltLab Suite
</li>
2837 <li>An application to create
<code>*.tar
</code> archives, e.g.
<a href=
"http://www.7-zip.org/">7-Zip
</a> on Windows
</li>
2839 <h2 id=
"the-packagexml-file">The package.xml File
<a class=
"headerlink" href=
"#the-packagexml-file" title=
"Permanent link">#
</a></h2>
2840 <p>We want to create a simple page that will display the sentence
"Hello World" embedded
2841 into the application frame. Create an empty directory in the workspace of your choice
2843 <p>Create a new file called
<code>package.xml
</code> and insert the code below:
</p>
2844 <div class=
"highlight"><table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal"> 1</span>
2845 <span class=
"normal"> 2</span>
2846 <span class=
"normal"> 3</span>
2847 <span class=
"normal"> 4</span>
2848 <span class=
"normal"> 5</span>
2849 <span class=
"normal"> 6</span>
2850 <span class=
"normal"> 7</span>
2851 <span class=
"normal"> 8</span>
2852 <span class=
"normal"> 9</span>
2853 <span class=
"normal">10</span>
2854 <span class=
"normal">11</span>
2855 <span class=
"normal">12</span>
2856 <span class=
"normal">13</span>
2857 <span class=
"normal">14</span>
2858 <span class=
"normal">15</span>
2859 <span class=
"normal">16</span>
2860 <span class=
"normal">17</span>
2861 <span class=
"normal">18</span>
2862 <span class=
"normal">19</span>
2863 <span class=
"normal">20</span>
2864 <span class=
"normal">21</span>
2865 <span class=
"normal">22</span></pre></div></td><td class=
"code"><div><pre><span></span><code><span class=
"cp"><?xml version=
"1.0" encoding=
"UTF-
8"?
></span>
2866 <span class=
"nt"><package
</span><span class=
"w"> </span><span class=
"na">xmlns=
</span><span class=
"s">"http://www.woltlab.com
"</span><span class=
"w"> </span><span class=
"na">xmlns:xsi=
</span><span class=
"s">"http://www.w3.org/
2001/XMLSchema-instance
"</span><span class=
"w"> </span><span class=
"na">xsi:schemaLocation=
</span><span class=
"s">"http://www.woltlab.com http://www.woltlab.com/XSD/
2019/package.xsd
"</span><span class=
"w"> </span><span class=
"na">name=
</span><span class=
"s">"com.example.test
"</span><span class=
"nt">></span>
2867 <span class=
"w"> </span><span class=
"nt"><packageinformation
></span>
2868 <span class=
"w"> </span><span class=
"cm"><!-- com.example.test --
></span>
2869 <span class=
"w"> </span><span class=
"nt"><packagename
></span>Simple
<span class=
"w"> </span>Package
<span class=
"nt"></packagename
></span>
2870 <span class=
"w"> </span><span class=
"nt"><packagedescription
></span>A
<span class=
"w"> </span>simple
<span class=
"w"> </span>package
<span class=
"w"> </span>to
<span class=
"w"> </span>demonstrate
<span class=
"w"> </span>the
<span class=
"w"> </span>package
<span class=
"w"> </span>system
<span class=
"w"> </span>of
<span class=
"w"> </span>WoltLab
<span class=
"w"> </span>Suite
<span class=
"w"> </span>Core
<span class=
"nt"></packagedescription
></span>
2871 <span class=
"w"> </span><span class=
"nt"><version
></span>1.0.0<span class=
"nt"></version
></span>
2872 <span class=
"w"> </span><span class=
"nt"><date
></span>2019-
04-
28<span class=
"nt"></date
></span>
2873 <span class=
"w"> </span><span class=
"nt"></packageinformation
></span>
2874 <span class=
"w"> </span><span class=
"nt"><authorinformation
></span>
2875 <span class=
"w"> </span><span class=
"nt"><author
></span>Your
<span class=
"w"> </span>Name
<span class=
"nt"></author
></span>
2876 <span class=
"w"> </span><span class=
"nt"><authorurl
></span>http://www.example.com
<span class=
"nt"></authorurl
></span>
2877 <span class=
"w"> </span><span class=
"nt"></authorinformation
></span>
2878 <span class=
"w"> </span><span class=
"nt"><excludedpackages
></span>
2879 <span class=
"w"> </span><span class=
"nt"><excludedpackage
</span><span class=
"w"> </span><span class=
"na">version=
</span><span class=
"s">"6.0.0 Alpha
1"</span><span class=
"nt">></span>com.woltlab.wcf
<span class=
"nt"></excludedpackage
></span>
2880 <span class=
"w"> </span><span class=
"nt"></excludedpackages
></span>
2881 <span class=
"w"> </span><span class=
"nt"><instructions
</span><span class=
"w"> </span><span class=
"na">type=
</span><span class=
"s">"install
"</span><span class=
"nt">></span>
2882 <span class=
"w"> </span><span class=
"nt"><instruction
</span><span class=
"w"> </span><span class=
"na">type=
</span><span class=
"s">"file
"</span><span class=
"w"> </span><span class=
"nt">/
></span>
2883 <span class=
"w"> </span><span class=
"nt"><instruction
</span><span class=
"w"> </span><span class=
"na">type=
</span><span class=
"s">"template
"</span><span class=
"w"> </span><span class=
"nt">/
></span>
2884 <span class=
"w"> </span><span class=
"nt"><instruction
</span><span class=
"w"> </span><span class=
"na">type=
</span><span class=
"s">"page
"</span><span class=
"w"> </span><span class=
"nt">/
></span>
2885 <span class=
"w"> </span><span class=
"nt"></instructions
></span>
2886 <span class=
"nt"></package
></span>
2887 </code></pre></div></td></tr></table></div>
2888 <p>There is an
<a href=
"../package/package-xml/">entire chapter
</a> on the package system that explains what the code above
2889 does and how you can adjust it to fit your needs. For now we'll keep it as it is.
</p>
2890 <h2 id=
"the-php-class">The PHP Class
<a class=
"headerlink" href=
"#the-php-class" title=
"Permanent link">#
</a></h2>
2891 <p>The next step is to create the PHP class which will serve our page:
</p>
2893 <li>Create the directory
<code>files
</code> in the same directory where
<code>package.xml
</code> is located
</li>
2894 <li>Open
<code>files
</code> and create the directory
<code>lib
</code></li>
2895 <li>Open
<code>lib
</code> and create the directory
<code>page
</code></li>
2896 <li>Within the directory
<code>page
</code>, please create the file
<code>TestPage.class.php
</code></li>
2898 <p>Copy and paste the following code into the
<code>TestPage.class.php
</code>:
</p>
2899 <div class=
"highlight"><table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal"> 1</span>
2900 <span class=
"normal"> 2</span>
2901 <span class=
"normal"> 3</span>
2902 <span class=
"normal"> 4</span>
2903 <span class=
"normal"> 5</span>
2904 <span class=
"normal"> 6</span>
2905 <span class=
"normal"> 7</span>
2906 <span class=
"normal"> 8</span>
2907 <span class=
"normal"> 9</span>
2908 <span class=
"normal">10</span>
2909 <span class=
"normal">11</span>
2910 <span class=
"normal">12</span>
2911 <span class=
"normal">13</span>
2912 <span class=
"normal">14</span>
2913 <span class=
"normal">15</span>
2914 <span class=
"normal">16</span>
2915 <span class=
"normal">17</span>
2916 <span class=
"normal">18</span>
2917 <span class=
"normal">19</span>
2918 <span class=
"normal">20</span>
2919 <span class=
"normal">21</span>
2920 <span class=
"normal">22</span>
2921 <span class=
"normal">23</span>
2922 <span class=
"normal">24</span>
2923 <span class=
"normal">25</span>
2924 <span class=
"normal">26</span>
2925 <span class=
"normal">27</span>
2926 <span class=
"normal">28</span>
2927 <span class=
"normal">29</span>
2928 <span class=
"normal">30</span>
2929 <span class=
"normal">31</span>
2930 <span class=
"normal">32</span>
2931 <span class=
"normal">33</span>
2932 <span class=
"normal">34</span>
2933 <span class=
"normal">35</span>
2934 <span class=
"normal">36</span>
2935 <span class=
"normal">37</span>
2936 <span class=
"normal">38</span>
2937 <span class=
"normal">39</span>
2938 <span class=
"normal">40</span>
2939 <span class=
"normal">41</span>
2940 <span class=
"normal">42</span>
2941 <span class=
"normal">43</span>
2942 <span class=
"normal">44</span>
2943 <span class=
"normal">45</span>
2944 <span class=
"normal">46</span>
2945 <span class=
"normal">47</span></pre></div></td><td class=
"code"><div><pre><span></span><code><span class=
"o"><?
</span><span class=
"nx">php
</span>
2946 <span class=
"k">namespace
</span> <span class=
"nx">wcf\page
</span><span class=
"p">;
</span>
2947 <span class=
"k">use
</span> <span class=
"nx">wcf\system\WCF
</span><span class=
"p">;
</span>
2949 <span class=
"sd">/**
</span>
2950 <span class=
"sd"> * A simple test page for demonstration purposes.
</span>
2951 <span class=
"sd"> *
</span>
2952 <span class=
"sd"> * @author YOUR NAME
</span>
2953 <span class=
"sd"> * @license GNU Lesser General Public License
<http://opensource.org/licenses/lgpl-license.php
></span>
2954 <span class=
"sd"> */
</span>
2955 <span class=
"k">class
</span> <span class=
"nc">TestPage
</span> <span class=
"k">extends
</span> <span class=
"nx">AbstractPage
</span> <span class=
"p">{
</span>
2956 <span class=
"sd">/**
</span>
2957 <span class=
"sd"> * @var string
</span>
2958 <span class=
"sd"> */
</span>
2959 <span class=
"k">protected
</span> <span class=
"nv">$greet
</span> <span class=
"o">=
</span> <span class=
"s1">''</span><span class=
"p">;
</span>
2961 <span class=
"sd">/**
</span>
2962 <span class=
"sd"> * @inheritDoc
</span>
2963 <span class=
"sd"> */
</span>
2964 <span class=
"k">public
</span> <span class=
"k">function
</span> <span class=
"nf">readParameters
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2965 <span class=
"k">parent
</span><span class=
"o">::
</span><span class=
"na">readParameters
</span><span class=
"p">();
</span>
2967 <span class=
"k">if
</span> <span class=
"p">(
</span><span class=
"nb">isset
</span><span class=
"p">(
</span><span class=
"nv">$_GET
</span><span class=
"p">[
</span><span class=
"s1">'greet
'</span><span class=
"p">]))
</span> <span class=
"nv">$this
</span><span class=
"o">-
></span><span class=
"na">greet
</span> <span class=
"o">=
</span> <span class=
"nv">$_GET
</span><span class=
"p">[
</span><span class=
"s1">'greet
'</span><span class=
"p">];
</span>
2968 <span class=
"p">}
</span>
2970 <span class=
"sd">/**
</span>
2971 <span class=
"sd"> * @inheritDoc
</span>
2972 <span class=
"sd"> */
</span>
2973 <span class=
"k">public
</span> <span class=
"k">function
</span> <span class=
"nf">readData
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2974 <span class=
"k">parent
</span><span class=
"o">::
</span><span class=
"na">readData
</span><span class=
"p">();
</span>
2976 <span class=
"k">if
</span> <span class=
"p">(
</span><span class=
"k">empty
</span><span class=
"p">(
</span><span class=
"nv">$this
</span><span class=
"o">-
></span><span class=
"na">greet
</span><span class=
"p">))
</span> <span class=
"p">{
</span>
2977 <span class=
"nv">$this
</span><span class=
"o">-
></span><span class=
"na">greet
</span> <span class=
"o">=
</span> <span class=
"s1">'World
'</span><span class=
"p">;
</span>
2978 <span class=
"p">}
</span>
2979 <span class=
"p">}
</span>
2981 <span class=
"sd">/**
</span>
2982 <span class=
"sd"> * @inheritDoc
</span>
2983 <span class=
"sd"> */
</span>
2984 <span class=
"k">public
</span> <span class=
"k">function
</span> <span class=
"nf">assignVariables
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2985 <span class=
"k">parent
</span><span class=
"o">::
</span><span class=
"na">assignVariables
</span><span class=
"p">();
</span>
2987 <span class=
"nx">WCF
</span><span class=
"o">::
</span><span class=
"na">getTPL
</span><span class=
"p">()
</span><span class=
"o">-
></span><span class=
"na">assign
</span><span class=
"p">([
</span>
2988 <span class=
"s1">'greet
'</span> <span class=
"o">=
></span> <span class=
"nv">$this
</span><span class=
"o">-
></span><span class=
"na">greet
</span>
2989 <span class=
"p">]);
</span>
2990 <span class=
"p">}
</span>
2991 <span class=
"p">}
</span>
2992 </code></pre></div></td></tr></table></div>
2993 <p>The class inherits from
<a href=
"https://github.com/WoltLab/WCF/blob/master/wcfsetup/install/files/lib/page/AbstractPage.class.php">wcf\page\AbstractPage
</a>, the default implementation of pages without form controls. It
2994 defines quite a few methods that will be automatically invoked in a specific order, for example
<code>readParameters()
</code> before
<code>readData()
</code> and finally
<code>assignVariables()
</code> to pass arbitrary values to the template.
</p>
2995 <p>The property
<code>$greet
</code> is defined as
<code>World
</code>, but can optionally be populated through a GET variable (
<code>index.php?test/
&greet=You
</code> would output
<code>Hello You!
</code>). This extra code illustrates the separation of data
2996 processing that takes place within all sort of pages, where all user-supplied data is read from within a single method. It helps organizing the code, but most of all it enforces a clean class logic that does not
2997 start reading user input at random places, including the risk to only escape the input of variable
<code>$_GET['foo']
</code> 4 out of
5 times.
</p>
2998 <p>Reading and processing the data is only half the story, now we need a template to display the actual content for our page. You don't need to specify it yourself, it will be automatically guessed based on your
2999 namespace and class name, you can
<a href=
"#template-guessing">read more about it later
</a>.
</p>
3000 <p>Last but not least, you must not include the closing PHP tag
<code>?
></code> at the end, it can cause PHP to break on whitespaces and is not required at all.
</p>
3001 <h2 id=
"the-template">The Template
<a class=
"headerlink" href=
"#the-template" title=
"Permanent link">#
</a></h2>
3002 <p>Navigate back to the root directory of your package until you see both the
<code>files
</code> directory and the
<code>package.xml
</code>. Now create a directory called
<code>templates
</code>, open it and create the file
<code>test.tpl
</code>.
</p>
3003 <div class=
"highlight"><table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span>
3004 <span class=
"normal">2</span>
3005 <span class=
"normal">3</span>
3006 <span class=
"normal">4</span>
3007 <span class=
"normal">5</span>
3008 <span class=
"normal">6</span>
3009 <span class=
"normal">7</span></pre></div></td><td class=
"code"><div><pre><span></span><code><span class=
"cp">{
</span><span class=
"nf">include
</span> <span class=
"na">file
</span><span class=
"o">=
</span><span class=
"s1">'header
'</span><span class=
"cp">}
</span>
3011 <span class=
"x"><div class=
"section
"></span>
3012 <span class=
"x"> Hello
</span><span class=
"cp">{
</span><span class=
"nv">$greet
</span><span class=
"cp">}
</span><span class=
"x">!
</span>
3013 <span class=
"x"></div
></span>
3015 <span class=
"cp">{
</span><span class=
"nf">include
</span> <span class=
"na">file
</span><span class=
"o">=
</span><span class=
"s1">'footer
'</span><span class=
"cp">}
</span>
3016 </code></pre></div></td></tr></table></div>
3017 <p>Templates are a mixture of HTML and Smarty-like template scripting to overcome the static nature of raw HTML. The above code will display the phrase
<code>Hello World!
</code> in the application frame, just as any other
3018 page would render. The included templates
<code>header
</code> and
<code>footer
</code> are responsible for the majority of the overall page functionality, but offer a whole lot of customization abilities to influence their behavior and appearance.
</p>
3019 <h2 id=
"the-page-definition">The Page Definition
<a class=
"headerlink" href=
"#the-page-definition" title=
"Permanent link">#
</a></h2>
3020 <p>The package now contains the PHP class and the matching template, but it is still missing the page definition. Please create the file
<code>page.xml
</code> in your project's root directory, thus on the same level as the
<code>package.xml
</code>.
</p>
3021 <div class=
"highlight"><table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal"> 1</span>
3022 <span class=
"normal"> 2</span>
3023 <span class=
"normal"> 3</span>
3024 <span class=
"normal"> 4</span>
3025 <span class=
"normal"> 5</span>
3026 <span class=
"normal"> 6</span>
3027 <span class=
"normal"> 7</span>
3028 <span class=
"normal"> 8</span>
3029 <span class=
"normal"> 9</span>
3030 <span class=
"normal">10</span></pre></div></td><td class=
"code"><div><pre><span></span><code><span class=
"cp"><?xml version=
"1.0" encoding=
"UTF-
8"?
></span>
3031 <span class=
"nt"><data
</span><span class=
"w"> </span><span class=
"na">xmlns=
</span><span class=
"s">"http://www.woltlab.com
"</span><span class=
"w"> </span><span class=
"na">xmlns:xsi=
</span><span class=
"s">"http://www.w3.org/
2001/XMLSchema-instance
"</span><span class=
"w"> </span><span class=
"na">xsi:schemaLocation=
</span><span class=
"s">"http://www.woltlab.com http://www.woltlab.com/XSD/
2019/page.xsd
"</span><span class=
"nt">></span>
3032 <span class=
"w"> </span><span class=
"nt"><import
></span>
3033 <span class=
"w"> </span><span class=
"nt"><page
</span><span class=
"w"> </span><span class=
"na">identifier=
</span><span class=
"s">"com.example.test.Test
"</span><span class=
"nt">></span>
3034 <span class=
"w"> </span><span class=
"nt"><controller
></span>wcf\page\TestPage
<span class=
"nt"></controller
></span>
3035 <span class=
"w"> </span><span class=
"nt"><name
</span><span class=
"w"> </span><span class=
"na">language=
</span><span class=
"s">"en
"</span><span class=
"nt">></span>Test
<span class=
"w"> </span>Page
<span class=
"nt"></name
></span>
3036 <span class=
"w"> </span><span class=
"nt"><pageType
></span>system
<span class=
"nt"></pageType
></span>
3037 <span class=
"w"> </span><span class=
"nt"></page
></span>
3038 <span class=
"w"> </span><span class=
"nt"></import
></span>
3039 <span class=
"nt"></data
></span>
3040 </code></pre></div></td></tr></table></div>
3041 <p>You can provide a lot more data for a page, including logical nesting and dedicated handler classes for display in menus.
</p>
3042 <h2 id=
"building-the-package">Building the Package
<a class=
"headerlink" href=
"#building-the-package" title=
"Permanent link">#
</a></h2>
3043 <p>If you have followed the above guidelines carefully, your package directory should now look like this:
</p>
3044 <div class=
"highlight"><table class=
"highlighttable"><tr><td class=
"linenos"><div class=
"linenodiv"><pre><span></span><span class=
"normal">1</span>
3045 <span class=
"normal">2</span>
3046 <span class=
"normal">3</span>
3047 <span class=
"normal">4</span>
3048 <span class=
"normal">5</span>
3049 <span class=
"normal">6</span>
3050 <span class=
"normal">7</span>
3051 <span class=
"normal">8</span></pre></div></td><td class=
"code"><div><pre><span></span><code>├── files
3054 │ └── TestPage.class.php
3059 </code></pre></div></td></tr></table></div>
3060 <p>Both files and templates are archive-based package components, that deploy their payload using tar archives rather than adding the raw files to the package file. Please create the archive
<code>files.tar
</code> and add the contents of the
<code>files/*
</code> directory, but not the directory
<code>files/
</code> itself. Repeat the same process for the
<code>templates
</code> directory, but this time with the file name
<code>templates.tar
</code>. Place both files in the root of your project.
</p>
3061 <p>Last but not least, create the package archive
<code>com.example.test.tar
</code> and add all the files listed below.
</p>
3063 <li><code>files.tar
</code></li>
3064 <li><code>package.xml
</code></li>
3065 <li><code>page.xml
</code></li>
3066 <li><code>templates.tar
</code></li>
3068 <p>The archive's filename can be anything you want, all though it is the general convention to use the package name itself for easier recognition.
</p>
3069 <h2 id=
"installation">Installation
<a class=
"headerlink" href=
"#installation" title=
"Permanent link">#
</a></h2>
3070 <p>Open the Administration Control Panel and navigate to
<code>Configuration
> Packages
> Install Package
</code>, click on
<code>Upload Package
</code> and select the file
<code>com.example.test.tar
</code> from your disk. Follow the on-screen instructions until it has been successfully installed.
</p>
3071 <p>Open a new browser tab and navigate to your newly created page. If WoltLab Suite is installed at
<code>https://example.com/wsc/
</code>, then the URL should read
<code>https://example.com/wsc/index.php?test/
</code>.
</p>
3072 <p>Congratulations, you have just created your first package!
</p>
3073 <h2 id=
"developer-tools">Developer Tools
<a class=
"headerlink" href=
"#developer-tools" title=
"Permanent link">#
</a></h2>
3074 <p>The developer tools provide an interface to synchronize the data of an installed package with a bare repository on the local disk. You can re-import most PIPs at any time and have the changes applied without crafting a manual update. This process simulates a regular package update with a single PIP only, and resets the cache after the import has been completed.
</p>
3075 <h3 id=
"registering-a-project">Registering a Project
<a class=
"headerlink" href=
"#registering-a-project" title=
"Permanent link">#
</a></h3>
3076 <p>Projects require the absolute path to the package directory, that is, the directory where it can find the
<code>package.xml
</code>. It is not required to install an package to register it as a project, but you have to install it in order to work with it. It does not install the package by itself!
</p>
3077 <p>There is a special button on the project list that allows for a mass-import of projects based on a search path. Each direct child directory of the provided path will be tested and projects created this way will use the identifier extracted from the
<code>package.xml
</code>.
</p>
3078 <h3 id=
"synchronizing">Synchronizing
<a class=
"headerlink" href=
"#synchronizing" title=
"Permanent link">#
</a></h3>
3079 <p>The install instructions in the
<code>package.xml
</code> are ignored when offering the PIP imports, the detection works entirely based on the default filename for each PIP. On top of that, only PIPs that implement the interface
<code>wcf\system\devtools\pip\IIdempotentPackageInstallationPlugin
</code> are valid for import, as it indicates that importing the PIP multiple times will have no side-effects and that the result is deterministic regardless of the number of times it has been imported.
</p>
3080 <p>Some built-in PIPs, such as
<code>sql
</code> or
<code>script
</code>, do not qualify for this step and remain unavailable at all times. However, you can still craft and perform an actual package update to have these PIPs executed.
</p>
3081 <h2 id=
"appendix">Appendix
<a class=
"headerlink" href=
"#appendix" title=
"Permanent link">#
</a></h2>
3082 <h3 id=
"template-guessing">Template Guessing
<a class=
"headerlink" href=
"#template-guessing" title=
"Permanent link">#
</a></h3>
3083 <p>The class name including the namespace is used to automatically determine the path to the template and its name. The example above used the page class name
<code>wcf\page\TestPage
</code> that is then split into four distinct parts:
</p>
3085 <li><code>wcf
</code>, the internal abbreviation of WoltLab Suite Core (previously known as WoltLab Community Framework)
</li>
3086 <li><code>\page\
</code> (ignored)
</li>
3087 <li><code>Test
</code>, the actual name that is used for both the template and the URL
</li>
3088 <li><code>Page
</code> (page type, ignored)
</li>
3090 <p>The fragments
<code>1.
</code> and
<code>3.
</code> from above are used to construct the path to the template:
<code><installDirOfWSC
>/templates/test.tpl
</code> (the first letter of
<code>Test
</code> is being converted to lower-case).
</p>
3093 <div class=
"md-source-file">
3115 <footer class=
"md-footer">
3117 <div class=
"md-footer-meta md-typeset">
3118 <div class=
"md-footer-meta__inner md-grid">
3119 <div class=
"md-copyright">
3121 <div class=
"md-copyright__highlight">
3122 Copyright ©
2020 WoltLab GmbH
3127 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
3133 <div class=
"md-copyright">
3134 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
3135 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
3143 <div class=
"md-dialog" data-md-component=
"dialog">
3144 <div class=
"md-dialog__inner md-typeset"></div>
3147 <script id=
"__config" type=
"application/json">{
"base":
"..",
"features": [
"navigation.tracking"],
"search":
"../assets/javascripts/workers/search.208ed371.min.js",
"translations": {
"clipboard.copied":
"Copied to clipboard",
"clipboard.copy":
"Copy to clipboard",
"search.result.more.one":
"1 more on this page",
"search.result.more.other":
"# more on this page",
"search.result.none":
"No matching documents",
"search.result.one":
"1 matching document",
"search.result.other":
"# matching documents",
"search.result.placeholder":
"Type to start searching",
"search.result.term.missing":
"Missing",
"select.version":
"Select version"},
"version": {
"provider":
"mike"}}
</script>
3150 <script src=
"../assets/javascripts/bundle.407015b8.min.js"></script>