3 <html lang=
"en" class=
"no-js">
7 <meta name=
"viewport" content=
"width=device-width,initial-scale=1">
12 <link rel=
"icon" href=
"../assets/default.favicon.ico">
13 <meta name=
"generator" content=
"mkdocs-1.1.2, mkdocs-material-7.1.0">
17 <title>Getting Started - WoltLab Suite Documentation
</title>
21 <link rel=
"stylesheet" href=
"../assets/stylesheets/main.33e2939f.min.css">
24 <link rel=
"stylesheet" href=
"../assets/stylesheets/palette.ef6f36e2.min.css">
28 <meta name=
"theme-color" content=
"#009485">
38 <link rel=
"stylesheet" href=
"../stylesheets/extra.css">
52 <body dir=
"ltr" data-md-color-scheme=
"" data-md-color-primary=
"teal" data-md-color-accent=
"">
55 <script>function __prefix(e){return new URL(
"..",location).pathname+
"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}
</script>
57 <input class=
"md-toggle" data-md-toggle=
"drawer" type=
"checkbox" id=
"__drawer" autocomplete=
"off">
58 <input class=
"md-toggle" data-md-toggle=
"search" type=
"checkbox" id=
"__search" autocomplete=
"off">
59 <label class=
"md-overlay" for=
"__drawer"></label>
60 <div data-md-component=
"skip">
63 <a href=
"#creating-a-simple-package" class=
"md-skip">
68 <div data-md-component=
"announce">
70 <aside class=
"md-announce">
71 <div class=
"md-announce__inner md-grid md-typeset">
73 <a href=
"https://www.woltlab.com">Back to
<strong>woltlab.com
</strong></a>
80 <header class=
"md-header" data-md-component=
"header">
81 <nav class=
"md-header__inner md-grid" aria-label=
"Header">
82 <a href=
".." title=
"WoltLab Suite Documentation" class=
"md-header__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
84 <img src=
"../assets/logo.png" alt=
"logo">
87 <label class=
"md-header__button md-icon" for=
"__drawer">
88 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
90 <div class=
"md-header__title" data-md-component=
"header-title">
91 <div class=
"md-header__ellipsis">
92 <div class=
"md-header__topic">
93 <span class=
"md-ellipsis">
94 WoltLab Suite Documentation
97 <div class=
"md-header__topic" data-md-component=
"header-topic">
98 <span class=
"md-ellipsis">
109 <label class=
"md-header__button md-icon" for=
"__search">
110 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
113 <div class=
"md-search" data-md-component=
"search" role=
"dialog">
114 <label class=
"md-search__overlay" for=
"__search"></label>
115 <div class=
"md-search__inner" role=
"search">
116 <form class=
"md-search__form" name=
"search">
117 <input type=
"text" class=
"md-search__input" name=
"query" aria-label=
"Search" placeholder=
"Search" autocapitalize=
"off" autocorrect=
"off" autocomplete=
"off" spellcheck=
"false" data-md-component=
"search-query" data-md-state=
"active" required
>
118 <label class=
"md-search__icon md-icon" for=
"__search">
119 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
120 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
122 <button type=
"reset" class=
"md-search__icon md-icon" aria-label=
"Clear" tabindex=
"-1">
123 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 24 24"><path d=
"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
126 <div class=
"md-search__output">
127 <div class=
"md-search__scrollwrap" data-md-scrollfix
>
128 <div class=
"md-search-result" data-md-component=
"search-result">
129 <div class=
"md-search-result__meta">
132 <ol class=
"md-search-result__list"></ol>
140 <div class=
"md-header__source">
142 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
143 <div class=
"md-source__icon md-icon">
145 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
147 <div class=
"md-source__repository">
156 <div class=
"md-container" data-md-component=
"container">
161 <main class=
"md-main" data-md-component=
"main">
162 <div class=
"md-main__inner md-grid">
166 <div class=
"md-sidebar md-sidebar--primary" data-md-component=
"sidebar" data-md-type=
"navigation" >
167 <div class=
"md-sidebar__scrollwrap">
168 <div class=
"md-sidebar__inner">
172 <nav class=
"md-nav md-nav--primary" aria-label=
"Navigation" data-md-level=
"0">
173 <label class=
"md-nav__title" for=
"__drawer">
174 <a href=
".." title=
"WoltLab Suite Documentation" class=
"md-nav__button md-logo" aria-label=
"WoltLab Suite Documentation" data-md-component=
"logo">
176 <img src=
"../assets/logo.png" alt=
"logo">
179 WoltLab Suite Documentation
182 <div class=
"md-nav__source">
184 <a href=
"https://github.com/WoltLab/docs.woltlab.com/" title=
"Go to repository" class=
"md-source" data-md-component=
"source">
185 <div class=
"md-source__icon md-icon">
187 <svg xmlns=
"http://www.w3.org/2000/svg" viewBox=
"0 0 448 512"><path d=
"M439.55 236.05 244 40.45a28.87 28.87 0 0 0-40.81 0l-40.66 40.63 51.52 51.52c27.06-9.14 52.68 16.77 43.39 43.68l49.66 49.66c34.23-11.8 61.18 31 35.47 56.69-26.49 26.49-70.21-2.87-56-37.34L240.22 199v121.85c25.3 12.54 22.26 41.85 9.08 55a34.34 34.34 0 0 1-48.55 0c-17.57-17.6-11.07-46.91 11.25-56v-123c-20.8-8.51-24.6-30.74-18.64-45L142.57 101 8.45 235.14a28.86 28.86 0 0 0 0 40.81l195.61 195.6a28.86 28.86 0 0 0 40.8 0l194.69-194.69a28.86 28.86 0 0 0 0-40.81z"/></svg>
189 <div class=
"md-source__repository">
195 <ul class=
"md-nav__list" data-md-scrollfix
>
206 <li class=
"md-nav__item md-nav__item--active">
208 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"toc" type=
"checkbox" id=
"__toc">
213 <label class=
"md-nav__link md-nav__link--active" for=
"__toc">
215 <span class=
"md-nav__icon md-icon"></span>
218 <a href=
"./" class=
"md-nav__link md-nav__link--active">
223 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
229 <label class=
"md-nav__title" for=
"__toc">
230 <span class=
"md-nav__icon md-icon"></span>
233 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
235 <li class=
"md-nav__item">
236 <a href=
"#setup-and-requirements" class=
"md-nav__link">
237 Setup and Requirements
242 <li class=
"md-nav__item">
243 <a href=
"#the-packagexml-file" class=
"md-nav__link">
249 <li class=
"md-nav__item">
250 <a href=
"#the-php-class" class=
"md-nav__link">
256 <li class=
"md-nav__item">
257 <a href=
"#the-template" class=
"md-nav__link">
263 <li class=
"md-nav__item">
264 <a href=
"#the-page-definition" class=
"md-nav__link">
270 <li class=
"md-nav__item">
271 <a href=
"#building-the-package" class=
"md-nav__link">
277 <li class=
"md-nav__item">
278 <a href=
"#installation" class=
"md-nav__link">
284 <li class=
"md-nav__item">
285 <a href=
"#developer-tools" class=
"md-nav__link">
289 <nav class=
"md-nav" aria-label=
"Developer Tools">
290 <ul class=
"md-nav__list">
292 <li class=
"md-nav__item">
293 <a href=
"#registering-a-project" class=
"md-nav__link">
294 Registering a Project
299 <li class=
"md-nav__item">
300 <a href=
"#synchronizing" class=
"md-nav__link">
311 <li class=
"md-nav__item">
312 <a href=
"#appendix" class=
"md-nav__link">
316 <nav class=
"md-nav" aria-label=
"Appendix">
317 <ul class=
"md-nav__list">
319 <li class=
"md-nav__item">
320 <a href=
"#template-guessing" class=
"md-nav__link">
347 <li class=
"md-nav__item md-nav__item--nested">
350 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2" type=
"checkbox" id=
"__nav_2" >
352 <label class=
"md-nav__link" for=
"__nav_2">
354 <span class=
"md-nav__icon md-icon"></span>
356 <nav class=
"md-nav" aria-label=
"PHP API" data-md-level=
"1">
357 <label class=
"md-nav__title" for=
"__nav_2">
358 <span class=
"md-nav__icon md-icon"></span>
361 <ul class=
"md-nav__list" data-md-scrollfix
>
367 <li class=
"md-nav__item">
368 <a href=
"../php/pages/" class=
"md-nav__link">
379 <li class=
"md-nav__item">
380 <a href=
"../php/database-objects/" class=
"md-nav__link">
391 <li class=
"md-nav__item">
392 <a href=
"../php/database-access/" class=
"md-nav__link">
403 <li class=
"md-nav__item">
404 <a href=
"../php/exceptions/" class=
"md-nav__link">
416 <li class=
"md-nav__item md-nav__item--nested">
419 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5" type=
"checkbox" id=
"__nav_2_5" >
421 <label class=
"md-nav__link" for=
"__nav_2_5">
423 <span class=
"md-nav__icon md-icon"></span>
425 <nav class=
"md-nav" aria-label=
"API" data-md-level=
"2">
426 <label class=
"md-nav__title" for=
"__nav_2_5">
427 <span class=
"md-nav__icon md-icon"></span>
430 <ul class=
"md-nav__list" data-md-scrollfix
>
437 <li class=
"md-nav__item md-nav__item--nested">
440 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_1" type=
"checkbox" id=
"__nav_2_5_1" >
442 <label class=
"md-nav__link" for=
"__nav_2_5_1">
444 <span class=
"md-nav__icon md-icon"></span>
446 <nav class=
"md-nav" aria-label=
"Caches" data-md-level=
"3">
447 <label class=
"md-nav__title" for=
"__nav_2_5_1">
448 <span class=
"md-nav__icon md-icon"></span>
451 <ul class=
"md-nav__list" data-md-scrollfix
>
457 <li class=
"md-nav__item">
458 <a href=
"../php/api/caches/" class=
"md-nav__link">
469 <li class=
"md-nav__item">
470 <a href=
"../php/api/caches_persistent-caches/" class=
"md-nav__link">
481 <li class=
"md-nav__item">
482 <a href=
"../php/api/caches_runtime-caches/" class=
"md-nav__link">
499 <li class=
"md-nav__item">
500 <a href=
"../php/api/comments/" class=
"md-nav__link">
511 <li class=
"md-nav__item">
512 <a href=
"../php/api/cronjobs/" class=
"md-nav__link">
523 <li class=
"md-nav__item">
524 <a href=
"../php/api/events/" class=
"md-nav__link">
536 <li class=
"md-nav__item md-nav__item--nested">
539 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_2_5_5" type=
"checkbox" id=
"__nav_2_5_5" >
541 <label class=
"md-nav__link" for=
"__nav_2_5_5">
543 <span class=
"md-nav__icon md-icon"></span>
545 <nav class=
"md-nav" aria-label=
"Form Builder" data-md-level=
"3">
546 <label class=
"md-nav__title" for=
"__nav_2_5_5">
547 <span class=
"md-nav__icon md-icon"></span>
550 <ul class=
"md-nav__list" data-md-scrollfix
>
556 <li class=
"md-nav__item">
557 <a href=
"../php/api/form_builder/overview/" class=
"md-nav__link">
568 <li class=
"md-nav__item">
569 <a href=
"../php/api/form_builder/structure/" class=
"md-nav__link">
580 <li class=
"md-nav__item">
581 <a href=
"../php/api/form_builder/form_fields/" class=
"md-nav__link">
592 <li class=
"md-nav__item">
593 <a href=
"../php/api/form_builder/validation_data/" class=
"md-nav__link">
604 <li class=
"md-nav__item">
605 <a href=
"../php/api/form_builder/dependencies/" class=
"md-nav__link">
622 <li class=
"md-nav__item">
623 <a href=
"../php/api/package_installation_plugins/" class=
"md-nav__link">
624 Package Installation Plugins
634 <li class=
"md-nav__item">
635 <a href=
"../php/api/user_activity_points/" class=
"md-nav__link">
646 <li class=
"md-nav__item">
647 <a href=
"../php/api/user_notifications/" class=
"md-nav__link">
658 <li class=
"md-nav__item">
659 <a href=
"../php/api/sitemaps/" class=
"md-nav__link">
676 <li class=
"md-nav__item">
677 <a href=
"../php/code-style/" class=
"md-nav__link">
688 <li class=
"md-nav__item">
689 <a href=
"../php/apps/" class=
"md-nav__link">
700 <li class=
"md-nav__item">
701 <a href=
"../php/gdpr/" class=
"md-nav__link">
722 <li class=
"md-nav__item md-nav__item--nested">
725 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_3" type=
"checkbox" id=
"__nav_3" >
727 <label class=
"md-nav__link" for=
"__nav_3">
728 Languages, Templates & CSS
729 <span class=
"md-nav__icon md-icon"></span>
731 <nav class=
"md-nav" aria-label=
"Languages, Templates & CSS" data-md-level=
"1">
732 <label class=
"md-nav__title" for=
"__nav_3">
733 <span class=
"md-nav__icon md-icon"></span>
734 Languages, Templates & CSS
736 <ul class=
"md-nav__list" data-md-scrollfix
>
742 <li class=
"md-nav__item">
743 <a href=
"../view/languages/" class=
"md-nav__link">
754 <li class=
"md-nav__item">
755 <a href=
"../view/templates/" class=
"md-nav__link">
766 <li class=
"md-nav__item">
767 <a href=
"../view/template-plugins/" class=
"md-nav__link">
778 <li class=
"md-nav__item">
779 <a href=
"../view/css/" class=
"md-nav__link">
800 <li class=
"md-nav__item md-nav__item--nested">
803 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4" type=
"checkbox" id=
"__nav_4" >
805 <label class=
"md-nav__link" for=
"__nav_4">
806 TypeScript and JavaScript API
807 <span class=
"md-nav__icon md-icon"></span>
809 <nav class=
"md-nav" aria-label=
"TypeScript and JavaScript API" data-md-level=
"1">
810 <label class=
"md-nav__title" for=
"__nav_4">
811 <span class=
"md-nav__icon md-icon"></span>
812 TypeScript and JavaScript API
814 <ul class=
"md-nav__list" data-md-scrollfix
>
820 <li class=
"md-nav__item">
821 <a href=
"../javascript/general-usage/" class=
"md-nav__link">
832 <li class=
"md-nav__item">
833 <a href=
"../javascript/typescript/" class=
"md-nav__link">
845 <li class=
"md-nav__item md-nav__item--nested">
848 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_4_3" type=
"checkbox" id=
"__nav_4_3" >
850 <label class=
"md-nav__link" for=
"__nav_4_3">
852 <span class=
"md-nav__icon md-icon"></span>
854 <nav class=
"md-nav" aria-label=
"New API" data-md-level=
"2">
855 <label class=
"md-nav__title" for=
"__nav_4_3">
856 <span class=
"md-nav__icon md-icon"></span>
859 <ul class=
"md-nav__list" data-md-scrollfix
>
865 <li class=
"md-nav__item">
866 <a href=
"../javascript/new-api_writing-a-module/" class=
"md-nav__link">
877 <li class=
"md-nav__item">
878 <a href=
"../javascript/new-api_data-structures/" class=
"md-nav__link">
889 <li class=
"md-nav__item">
890 <a href=
"../javascript/new-api_core/" class=
"md-nav__link">
901 <li class=
"md-nav__item">
902 <a href=
"../javascript/new-api_dom/" class=
"md-nav__link">
913 <li class=
"md-nav__item">
914 <a href=
"../javascript/new-api_events/" class=
"md-nav__link">
925 <li class=
"md-nav__item">
926 <a href=
"../javascript/new-api_ajax/" class=
"md-nav__link">
937 <li class=
"md-nav__item">
938 <a href=
"../javascript/new-api_dialogs/" class=
"md-nav__link">
949 <li class=
"md-nav__item">
950 <a href=
"../javascript/new-api_browser/" class=
"md-nav__link">
951 Browser and Screen Sizes
961 <li class=
"md-nav__item">
962 <a href=
"../javascript/new-api_ui/" class=
"md-nav__link">
979 <li class=
"md-nav__item">
980 <a href=
"../javascript/legacy-api/" class=
"md-nav__link">
991 <li class=
"md-nav__item">
992 <a href=
"../javascript/helper-functions/" class=
"md-nav__link">
1003 <li class=
"md-nav__item">
1004 <a href=
"../javascript/code-snippets/" class=
"md-nav__link">
1025 <li class=
"md-nav__item md-nav__item--nested">
1028 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5" type=
"checkbox" id=
"__nav_5" >
1030 <label class=
"md-nav__link" for=
"__nav_5">
1032 <span class=
"md-nav__icon md-icon"></span>
1034 <nav class=
"md-nav" aria-label=
"Package Components" data-md-level=
"1">
1035 <label class=
"md-nav__title" for=
"__nav_5">
1036 <span class=
"md-nav__icon md-icon"></span>
1039 <ul class=
"md-nav__list" data-md-scrollfix
>
1045 <li class=
"md-nav__item">
1046 <a href=
"../package/package-xml/" class=
"md-nav__link">
1058 <li class=
"md-nav__item md-nav__item--nested">
1061 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_5_2" type=
"checkbox" id=
"__nav_5_2" >
1063 <label class=
"md-nav__link" for=
"__nav_5_2">
1065 <span class=
"md-nav__icon md-icon"></span>
1067 <nav class=
"md-nav" aria-label=
"PIPs" data-md-level=
"2">
1068 <label class=
"md-nav__title" for=
"__nav_5_2">
1069 <span class=
"md-nav__icon md-icon"></span>
1072 <ul class=
"md-nav__list" data-md-scrollfix
>
1078 <li class=
"md-nav__item">
1079 <a href=
"../package/pip/" class=
"md-nav__link">
1090 <li class=
"md-nav__item">
1091 <a href=
"../package/pip/acl-option/" class=
"md-nav__link">
1102 <li class=
"md-nav__item">
1103 <a href=
"../package/pip/acp-menu/" class=
"md-nav__link">
1114 <li class=
"md-nav__item">
1115 <a href=
"../package/pip/acp-search-provider/" class=
"md-nav__link">
1126 <li class=
"md-nav__item">
1127 <a href=
"../package/pip/acp-template/" class=
"md-nav__link">
1138 <li class=
"md-nav__item">
1139 <a href=
"../package/pip/bbcode/" class=
"md-nav__link">
1150 <li class=
"md-nav__item">
1151 <a href=
"../package/pip/box/" class=
"md-nav__link">
1162 <li class=
"md-nav__item">
1163 <a href=
"../package/pip/clipboard-action/" class=
"md-nav__link">
1174 <li class=
"md-nav__item">
1175 <a href=
"../package/pip/core-object/" class=
"md-nav__link">
1186 <li class=
"md-nav__item">
1187 <a href=
"../package/pip/cronjob/" class=
"md-nav__link">
1198 <li class=
"md-nav__item">
1199 <a href=
"../package/pip/database/" class=
"md-nav__link">
1210 <li class=
"md-nav__item">
1211 <a href=
"../package/pip/event-listener/" class=
"md-nav__link">
1222 <li class=
"md-nav__item">
1223 <a href=
"../package/pip/file/" class=
"md-nav__link">
1234 <li class=
"md-nav__item">
1235 <a href=
"../package/pip/language/" class=
"md-nav__link">
1246 <li class=
"md-nav__item">
1247 <a href=
"../package/pip/media-provider/" class=
"md-nav__link">
1258 <li class=
"md-nav__item">
1259 <a href=
"../package/pip/menu/" class=
"md-nav__link">
1270 <li class=
"md-nav__item">
1271 <a href=
"../package/pip/menu-item/" class=
"md-nav__link">
1282 <li class=
"md-nav__item">
1283 <a href=
"../package/pip/object-type/" class=
"md-nav__link">
1294 <li class=
"md-nav__item">
1295 <a href=
"../package/pip/object-type-definition/" class=
"md-nav__link">
1296 objectTypeDefinition
1306 <li class=
"md-nav__item">
1307 <a href=
"../package/pip/option/" class=
"md-nav__link">
1318 <li class=
"md-nav__item">
1319 <a href=
"../package/pip/page/" class=
"md-nav__link">
1330 <li class=
"md-nav__item">
1331 <a href=
"../package/pip/pip/" class=
"md-nav__link">
1342 <li class=
"md-nav__item">
1343 <a href=
"../package/pip/script/" class=
"md-nav__link">
1354 <li class=
"md-nav__item">
1355 <a href=
"../package/pip/smiley/" class=
"md-nav__link">
1366 <li class=
"md-nav__item">
1367 <a href=
"../package/pip/sql/" class=
"md-nav__link">
1378 <li class=
"md-nav__item">
1379 <a href=
"../package/pip/style/" class=
"md-nav__link">
1390 <li class=
"md-nav__item">
1391 <a href=
"../package/pip/template/" class=
"md-nav__link">
1402 <li class=
"md-nav__item">
1403 <a href=
"../package/pip/template-listener/" class=
"md-nav__link">
1414 <li class=
"md-nav__item">
1415 <a href=
"../package/pip/user-group-option/" class=
"md-nav__link">
1426 <li class=
"md-nav__item">
1427 <a href=
"../package/pip/user-menu/" class=
"md-nav__link">
1438 <li class=
"md-nav__item">
1439 <a href=
"../package/pip/user-notification-event/" class=
"md-nav__link">
1440 userNotificationEvent
1450 <li class=
"md-nav__item">
1451 <a href=
"../package/pip/user-option/" class=
"md-nav__link">
1462 <li class=
"md-nav__item">
1463 <a href=
"../package/pip/user-profile-menu/" class=
"md-nav__link">
1480 <li class=
"md-nav__item">
1481 <a href=
"../package/database-php-api/" class=
"md-nav__link">
1502 <li class=
"md-nav__item md-nav__item--nested">
1505 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6" type=
"checkbox" id=
"__nav_6" >
1507 <label class=
"md-nav__link" for=
"__nav_6">
1509 <span class=
"md-nav__icon md-icon"></span>
1511 <nav class=
"md-nav" aria-label=
"Migration" data-md-level=
"1">
1512 <label class=
"md-nav__title" for=
"__nav_6">
1513 <span class=
"md-nav__icon md-icon"></span>
1516 <ul class=
"md-nav__list" data-md-scrollfix
>
1523 <li class=
"md-nav__item md-nav__item--nested">
1526 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_1" type=
"checkbox" id=
"__nav_6_1" >
1528 <label class=
"md-nav__link" for=
"__nav_6_1">
1529 Migrating from WSC
5.3
1530 <span class=
"md-nav__icon md-icon"></span>
1532 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.3" data-md-level=
"2">
1533 <label class=
"md-nav__title" for=
"__nav_6_1">
1534 <span class=
"md-nav__icon md-icon"></span>
1535 Migrating from WSC
5.3
1537 <ul class=
"md-nav__list" data-md-scrollfix
>
1543 <li class=
"md-nav__item">
1544 <a href=
"../migration/wsc53/php/" class=
"md-nav__link">
1555 <li class=
"md-nav__item">
1556 <a href=
"../migration/wsc53/session/" class=
"md-nav__link">
1557 Session Handling and Authentication
1567 <li class=
"md-nav__item">
1568 <a href=
"../migration/wsc53/javascript/" class=
"md-nav__link">
1569 TypeScript and JavaScript
1579 <li class=
"md-nav__item">
1580 <a href=
"../migration/wsc53/templates/" class=
"md-nav__link">
1591 <li class=
"md-nav__item">
1592 <a href=
"../migration/wsc53/libraries/" class=
"md-nav__link">
1593 Third Party Libraries
1610 <li class=
"md-nav__item md-nav__item--nested">
1613 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_2" type=
"checkbox" id=
"__nav_6_2" >
1615 <label class=
"md-nav__link" for=
"__nav_6_2">
1616 Migrating from WSC
5.2
1617 <span class=
"md-nav__icon md-icon"></span>
1619 <nav class=
"md-nav" aria-label=
"Migrating from WSC 5.2" data-md-level=
"2">
1620 <label class=
"md-nav__title" for=
"__nav_6_2">
1621 <span class=
"md-nav__icon md-icon"></span>
1622 Migrating from WSC
5.2
1624 <ul class=
"md-nav__list" data-md-scrollfix
>
1630 <li class=
"md-nav__item">
1631 <a href=
"../migration/wsc52/php/" class=
"md-nav__link">
1642 <li class=
"md-nav__item">
1643 <a href=
"../migration/wsc52/templates/" class=
"md-nav__link">
1644 Templates and Languages
1654 <li class=
"md-nav__item">
1655 <a href=
"../migration/wsc52/libraries/" class=
"md-nav__link">
1656 Third Party Libraries
1673 <li class=
"md-nav__item md-nav__item--nested">
1676 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_3" type=
"checkbox" id=
"__nav_6_3" >
1678 <label class=
"md-nav__link" for=
"__nav_6_3">
1679 Migrating from WSC
3.1
1680 <span class=
"md-nav__icon md-icon"></span>
1682 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.1" data-md-level=
"2">
1683 <label class=
"md-nav__title" for=
"__nav_6_3">
1684 <span class=
"md-nav__icon md-icon"></span>
1685 Migrating from WSC
3.1
1687 <ul class=
"md-nav__list" data-md-scrollfix
>
1693 <li class=
"md-nav__item">
1694 <a href=
"../migration/wsc31/php/" class=
"md-nav__link">
1712 <li class=
"md-nav__item md-nav__item--nested">
1715 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_4" type=
"checkbox" id=
"__nav_6_4" >
1717 <label class=
"md-nav__link" for=
"__nav_6_4">
1718 Migrating from WSC
3.0
1719 <span class=
"md-nav__icon md-icon"></span>
1721 <nav class=
"md-nav" aria-label=
"Migrating from WSC 3.0" data-md-level=
"2">
1722 <label class=
"md-nav__title" for=
"__nav_6_4">
1723 <span class=
"md-nav__icon md-icon"></span>
1724 Migrating from WSC
3.0
1726 <ul class=
"md-nav__list" data-md-scrollfix
>
1732 <li class=
"md-nav__item">
1733 <a href=
"../migration/wsc30/php/" class=
"md-nav__link">
1744 <li class=
"md-nav__item">
1745 <a href=
"../migration/wsc30/javascript/" class=
"md-nav__link">
1756 <li class=
"md-nav__item">
1757 <a href=
"../migration/wsc30/templates/" class=
"md-nav__link">
1768 <li class=
"md-nav__item">
1769 <a href=
"../migration/wsc30/css/" class=
"md-nav__link">
1780 <li class=
"md-nav__item">
1781 <a href=
"../migration/wsc30/package/" class=
"md-nav__link">
1799 <li class=
"md-nav__item md-nav__item--nested">
1802 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_6_5" type=
"checkbox" id=
"__nav_6_5" >
1804 <label class=
"md-nav__link" for=
"__nav_6_5">
1805 Migrating from WCF
2.1
1806 <span class=
"md-nav__icon md-icon"></span>
1808 <nav class=
"md-nav" aria-label=
"Migrating from WCF 2.1" data-md-level=
"2">
1809 <label class=
"md-nav__title" for=
"__nav_6_5">
1810 <span class=
"md-nav__icon md-icon"></span>
1811 Migrating from WCF
2.1
1813 <ul class=
"md-nav__list" data-md-scrollfix
>
1819 <li class=
"md-nav__item">
1820 <a href=
"../migration/wcf21/php/" class=
"md-nav__link">
1831 <li class=
"md-nav__item">
1832 <a href=
"../migration/wcf21/templates/" class=
"md-nav__link">
1843 <li class=
"md-nav__item">
1844 <a href=
"../migration/wcf21/css/" class=
"md-nav__link">
1855 <li class=
"md-nav__item">
1856 <a href=
"../migration/wcf21/package/" class=
"md-nav__link">
1883 <li class=
"md-nav__item md-nav__item--nested">
1886 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7" type=
"checkbox" id=
"__nav_7" >
1888 <label class=
"md-nav__link" for=
"__nav_7">
1890 <span class=
"md-nav__icon md-icon"></span>
1892 <nav class=
"md-nav" aria-label=
"Tutorials" data-md-level=
"1">
1893 <label class=
"md-nav__title" for=
"__nav_7">
1894 <span class=
"md-nav__icon md-icon"></span>
1897 <ul class=
"md-nav__list" data-md-scrollfix
>
1904 <li class=
"md-nav__item md-nav__item--nested">
1907 <input class=
"md-nav__toggle md-toggle" data-md-toggle=
"__nav_7_1" type=
"checkbox" id=
"__nav_7_1" >
1909 <label class=
"md-nav__link" for=
"__nav_7_1">
1911 <span class=
"md-nav__icon md-icon"></span>
1913 <nav class=
"md-nav" aria-label=
"Tutorial Series" data-md-level=
"2">
1914 <label class=
"md-nav__title" for=
"__nav_7_1">
1915 <span class=
"md-nav__icon md-icon"></span>
1918 <ul class=
"md-nav__list" data-md-scrollfix
>
1924 <li class=
"md-nav__item">
1925 <a href=
"../tutorial/series/overview/" class=
"md-nav__link">
1936 <li class=
"md-nav__item">
1937 <a href=
"../tutorial/series/part_1/" class=
"md-nav__link">
1948 <li class=
"md-nav__item">
1949 <a href=
"../tutorial/series/part_2/" class=
"md-nav__link">
1960 <li class=
"md-nav__item">
1961 <a href=
"../tutorial/series/part_3/" class=
"md-nav__link">
1988 <div class=
"md-sidebar md-sidebar--secondary" data-md-component=
"sidebar" data-md-type=
"toc" >
1989 <div class=
"md-sidebar__scrollwrap">
1990 <div class=
"md-sidebar__inner">
1992 <nav class=
"md-nav md-nav--secondary" aria-label=
"Table of contents">
1998 <label class=
"md-nav__title" for=
"__toc">
1999 <span class=
"md-nav__icon md-icon"></span>
2002 <ul class=
"md-nav__list" data-md-component=
"toc" data-md-scrollfix
>
2004 <li class=
"md-nav__item">
2005 <a href=
"#setup-and-requirements" class=
"md-nav__link">
2006 Setup and Requirements
2011 <li class=
"md-nav__item">
2012 <a href=
"#the-packagexml-file" class=
"md-nav__link">
2013 The package.xml File
2018 <li class=
"md-nav__item">
2019 <a href=
"#the-php-class" class=
"md-nav__link">
2025 <li class=
"md-nav__item">
2026 <a href=
"#the-template" class=
"md-nav__link">
2032 <li class=
"md-nav__item">
2033 <a href=
"#the-page-definition" class=
"md-nav__link">
2039 <li class=
"md-nav__item">
2040 <a href=
"#building-the-package" class=
"md-nav__link">
2041 Building the Package
2046 <li class=
"md-nav__item">
2047 <a href=
"#installation" class=
"md-nav__link">
2053 <li class=
"md-nav__item">
2054 <a href=
"#developer-tools" class=
"md-nav__link">
2058 <nav class=
"md-nav" aria-label=
"Developer Tools">
2059 <ul class=
"md-nav__list">
2061 <li class=
"md-nav__item">
2062 <a href=
"#registering-a-project" class=
"md-nav__link">
2063 Registering a Project
2068 <li class=
"md-nav__item">
2069 <a href=
"#synchronizing" class=
"md-nav__link">
2080 <li class=
"md-nav__item">
2081 <a href=
"#appendix" class=
"md-nav__link">
2085 <nav class=
"md-nav" aria-label=
"Appendix">
2086 <ul class=
"md-nav__list">
2088 <li class=
"md-nav__item">
2089 <a href=
"#template-guessing" class=
"md-nav__link">
2108 <div class=
"md-content" data-md-component=
"content">
2109 <article class=
"md-content__inner md-typeset">
2112 <a href=
"https://github.com/WoltLab/docs.woltlab.com/edit/5.4/docs/getting-started.md" title=
"Edit this page" class=
"md-content__button md-icon">
2113 <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>
2117 <h1 id=
"creating-a-simple-package">Creating a simple package
<a class=
"headerlink" href=
"#creating-a-simple-package" title=
"Permanent link">#
</a></h1>
2118 <h2 id=
"setup-and-requirements">Setup and Requirements
<a class=
"headerlink" href=
"#setup-and-requirements" title=
"Permanent link">#
</a></h2>
2119 <p>This guide will help you to create a simple package that provides a simple test
2120 page. It is nothing too fancy, but you can use it as the foundation for your
2122 <p>There are some requirements you should met before starting:
</p>
2124 <li>Text editor with syntax highlighting for PHP,
<a href=
"https://notepad-plus-plus.org/">Notepad++
</a> is a solid pick
</li>
2125 <li><code>*.php
</code> and
<code>*.tpl
</code> should be encoded with ANSI/ASCII
</li>
2126 <li><code>*.xml
</code> are always encoded with UTF-
8, but omit the BOM (byte-order-mark)
</li>
2127 <li>Use tabs instead of spaces to indent lines
</li>
2128 <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>
2129 <li>An active installation of WoltLab Suite
3</li>
2130 <li>An application to create
<code>*.tar
</code> archives, e.g.
<a href=
"http://www.7-zip.org/">7-Zip
</a> on Windows
</li>
2132 <h2 id=
"the-packagexml-file">The package.xml File
<a class=
"headerlink" href=
"#the-packagexml-file" title=
"Permanent link">#
</a></h2>
2133 <p>We want to create a simple page that will display the sentence
"Hello World" embedded
2134 into the application frame. Create an empty directory in the workspace of your choice
2136 <p>Create a new file called
<code>package.xml
</code> and insert the code below:
</p>
2137 <div class=
"highlight"><pre><span></span><code><span class=
"cp"><?xml version=
"1.0" encoding=
"UTF-
8"?
></span>
2138 <span class=
"nt"><package
</span> <span class=
"na">xmlns=
</span><span class=
"s">"http://www.woltlab.com
"</span> <span class=
"na">xmlns:xsi=
</span><span class=
"s">"http://www.w3.org/
2001/XMLSchema-instance
"</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=
"na">name=
</span><span class=
"s">"com.example.test
"</span><span class=
"nt">></span>
2139 <span class=
"nt"><packageinformation
></span>
2140 <span class=
"c"><!-- com.example.test --
></span>
2141 <span class=
"nt"><packagename
></span>Simple Package
<span class=
"nt"></packagename
></span>
2142 <span class=
"nt"><packagedescription
></span>A simple package to demonstrate the package system of WoltLab Suite Core
<span class=
"nt"></packagedescription
></span>
2143 <span class=
"nt"><version
></span>1.0.0<span class=
"nt"></version
></span>
2144 <span class=
"nt"><date
></span>2019-
04-
28<span class=
"nt"></date
></span>
2145 <span class=
"nt"></packageinformation
></span>
2146 <span class=
"nt"><authorinformation
></span>
2147 <span class=
"nt"><author
></span>Your Name
<span class=
"nt"></author
></span>
2148 <span class=
"nt"><authorurl
></span>http://www.example.com
<span class=
"nt"></authorurl
></span>
2149 <span class=
"nt"></authorinformation
></span>
2150 <span class=
"nt"><excludedpackages
></span>
2151 <span class=
"nt"><excludedpackage
</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>
2152 <span class=
"nt"></excludedpackages
></span>
2153 <span class=
"nt"><instructions
</span> <span class=
"na">type=
</span><span class=
"s">"install
"</span><span class=
"nt">></span>
2154 <span class=
"nt"><instruction
</span> <span class=
"na">type=
</span><span class=
"s">"file
"</span> <span class=
"nt">/
></span>
2155 <span class=
"nt"><instruction
</span> <span class=
"na">type=
</span><span class=
"s">"template
"</span> <span class=
"nt">/
></span>
2156 <span class=
"nt"><instruction
</span> <span class=
"na">type=
</span><span class=
"s">"page
"</span> <span class=
"nt">/
></span>
2157 <span class=
"nt"></instructions
></span>
2158 <span class=
"nt"></package
></span>
2160 <p>There is an
<a href=
"../package/package-xml/">entire chapter
</a> on the package system that explains what the code above
2161 does and how you can adjust it to fit your needs. For now we'll keep it as it is.
</p>
2162 <h2 id=
"the-php-class">The PHP Class
<a class=
"headerlink" href=
"#the-php-class" title=
"Permanent link">#
</a></h2>
2163 <p>The next step is to create the PHP class which will serve our page:
</p>
2165 <li>Create the directory
<code>files
</code> in the same directory where
<code>package.xml
</code> is located
</li>
2166 <li>Open
<code>files
</code> and create the directory
<code>lib
</code></li>
2167 <li>Open
<code>lib
</code> and create the directory
<code>page
</code></li>
2168 <li>Within the directory
<code>page
</code>, please create the file
<code>TestPage.class.php
</code></li>
2170 <p>Copy and paste the following code into the
<code>TestPage.class.php
</code>:
</p>
2171 <div class=
"highlight"><pre><span></span><code><span class=
"o"><?
</span><span class=
"nx">php
</span>
2172 <span class=
"k">namespace
</span> <span class=
"nx">wcf\page
</span><span class=
"p">;
</span>
2173 <span class=
"k">use
</span> <span class=
"nx">wcf\system\WCF
</span><span class=
"p">;
</span>
2175 <span class=
"sd">/**
</span>
2176 <span class=
"sd"> * A simple test page for demonstration purposes.
</span>
2177 <span class=
"sd"> *
</span>
2178 <span class=
"sd"> * @author YOUR NAME
</span>
2179 <span class=
"sd"> * @license GNU Lesser General Public License
<http://opensource.org/licenses/lgpl-license.php
></span>
2180 <span class=
"sd"> */
</span>
2181 <span class=
"k">class
</span> <span class=
"nc">TestPage
</span> <span class=
"k">extends
</span> <span class=
"nx">AbstractPage
</span> <span class=
"p">{
</span>
2182 <span class=
"sd">/**
</span>
2183 <span class=
"sd"> * @var string
</span>
2184 <span class=
"sd"> */
</span>
2185 <span class=
"k">protected
</span> <span class=
"nv">$greet
</span> <span class=
"o">=
</span> <span class=
"s1">''</span><span class=
"p">;
</span>
2187 <span class=
"sd">/**
</span>
2188 <span class=
"sd"> * @inheritDoc
</span>
2189 <span class=
"sd"> */
</span>
2190 <span class=
"k">public
</span> <span class=
"k">function
</span> <span class=
"nf">readParameters
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2191 <span class=
"k">parent
</span><span class=
"o">::
</span><span class=
"na">readParameters
</span><span class=
"p">();
</span>
2193 <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>
2194 <span class=
"p">}
</span>
2196 <span class=
"sd">/**
</span>
2197 <span class=
"sd"> * @inheritDoc
</span>
2198 <span class=
"sd"> */
</span>
2199 <span class=
"k">public
</span> <span class=
"k">function
</span> <span class=
"nf">readData
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2200 <span class=
"k">parent
</span><span class=
"o">::
</span><span class=
"na">readData
</span><span class=
"p">();
</span>
2202 <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>
2203 <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>
2204 <span class=
"p">}
</span>
2205 <span class=
"p">}
</span>
2207 <span class=
"sd">/**
</span>
2208 <span class=
"sd"> * @inheritDoc
</span>
2209 <span class=
"sd"> */
</span>
2210 <span class=
"k">public
</span> <span class=
"k">function
</span> <span class=
"nf">assignVariables
</span><span class=
"p">()
</span> <span class=
"p">{
</span>
2211 <span class=
"k">parent
</span><span class=
"o">::
</span><span class=
"na">assignVariables
</span><span class=
"p">();
</span>
2213 <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>
2214 <span class=
"s1">'greet
'</span> <span class=
"o">=
></span> <span class=
"nv">$this
</span><span class=
"o">-
></span><span class=
"na">greet
</span>
2215 <span class=
"p">]);
</span>
2216 <span class=
"p">}
</span>
2217 <span class=
"p">}
</span>
2219 <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
2220 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>
2221 <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
2222 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
2223 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>
2224 <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
2225 namespace and class name, you can
<a href=
"#template-guessing">read more about it later
</a>.
</p>
2226 <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>
2227 <h2 id=
"the-template">The Template
<a class=
"headerlink" href=
"#the-template" title=
"Permanent link">#
</a></h2>
2228 <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>
2229 <div class=
"highlight"><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><span class=
"x"></span>
2231 <span class=
"x"><div class=
"section
"></span>
2232 <span class=
"x"> Hello
</span><span class=
"cp">{
</span><span class=
"nv">$greet
</span><span class=
"cp">}
</span><span class=
"x">!
</span>
2233 <span class=
"x"></div
></span>
2235 <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><span class=
"x"></span>
2237 <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
2238 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>
2239 <h2 id=
"the-page-definition">The Page Definition
<a class=
"headerlink" href=
"#the-page-definition" title=
"Permanent link">#
</a></h2>
2240 <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>
2241 <div class=
"highlight"><pre><span></span><code><span class=
"cp"><?xml version=
"1.0" encoding=
"UTF-
8"?
></span>
2242 <span class=
"nt"><data
</span> <span class=
"na">xmlns=
</span><span class=
"s">"http://www.woltlab.com
"</span> <span class=
"na">xmlns:xsi=
</span><span class=
"s">"http://www.w3.org/
2001/XMLSchema-instance
"</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>
2243 <span class=
"nt"><import
></span>
2244 <span class=
"nt"><page
</span> <span class=
"na">identifier=
</span><span class=
"s">"com.example.test.Test
"</span><span class=
"nt">></span>
2245 <span class=
"nt"><controller
></span>wcf\page\TestPage
<span class=
"nt"></controller
></span>
2246 <span class=
"nt"><name
</span> <span class=
"na">language=
</span><span class=
"s">"en
"</span><span class=
"nt">></span>Test Page
<span class=
"nt"></name
></span>
2247 <span class=
"nt"><pageType
></span>system
<span class=
"nt"></pageType
></span>
2248 <span class=
"nt"></page
></span>
2249 <span class=
"nt"></import
></span>
2250 <span class=
"nt"></data
></span>
2252 <p>You can provide a lot more data for a page, including logical nesting and dedicated handler classes for display in menus.
</p>
2253 <h2 id=
"building-the-package">Building the Package
<a class=
"headerlink" href=
"#building-the-package" title=
"Permanent link">#
</a></h2>
2254 <p>If you have followed the above guidelines carefully, your package directory should now look like this:
</p>
2255 <div class=
"highlight"><pre><span></span><code>├── files
2258 │ │ ├── TestPage.class.php
2264 <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>
2265 <p>Last but not least, create the package archive
<code>com.example.test.tar
</code> and add all the files listed below.
</p>
2267 <li><code>files.tar
</code></li>
2268 <li><code>package.xml
</code></li>
2269 <li><code>page.xml
</code></li>
2270 <li><code>templates.tar
</code></li>
2272 <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>
2273 <h2 id=
"installation">Installation
<a class=
"headerlink" href=
"#installation" title=
"Permanent link">#
</a></h2>
2274 <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>
2275 <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>
2276 <p>Congratulations, you have just created your first package!
</p>
2277 <h2 id=
"developer-tools">Developer Tools
<a class=
"headerlink" href=
"#developer-tools" title=
"Permanent link">#
</a></h2>
2278 <div class=
"admonition warning">
2279 <p class=
"admonition-title">This feature is available with WoltLab Suite
3.1 or newer only.
</p>
2281 <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>
2282 <h3 id=
"registering-a-project">Registering a Project
<a class=
"headerlink" href=
"#registering-a-project" title=
"Permanent link">#
</a></h3>
2283 <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>
2284 <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>
2285 <h3 id=
"synchronizing">Synchronizing
<a class=
"headerlink" href=
"#synchronizing" title=
"Permanent link">#
</a></h3>
2286 <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>
2287 <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>
2288 <h2 id=
"appendix">Appendix
<a class=
"headerlink" href=
"#appendix" title=
"Permanent link">#
</a></h2>
2289 <h3 id=
"template-guessing">Template Guessing
<a class=
"headerlink" href=
"#template-guessing" title=
"Permanent link">#
</a></h3>
2290 <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>
2292 <li><code>wcf
</code>, the internal abbreviation of WoltLab Suite Core (previously known as WoltLab Community Framework)
</li>
2293 <li><code>\page\
</code> (ignored)
</li>
2294 <li><code>Test
</code>, the actual name that is used for both the template and the URL
</li>
2295 <li><code>Page
</code> (page type, ignored)
</li>
2297 <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>
2303 <div class=
"md-source-date">
2306 Last update:
2021-
01-
08
2325 <footer class=
"md-footer">
2327 <nav class=
"md-footer__inner md-grid" aria-label=
"Footer">
2330 <a href=
"../php/pages/" class=
"md-footer__link md-footer__link--next" rel=
"next">
2331 <div class=
"md-footer__title">
2332 <div class=
"md-ellipsis">
2333 <span class=
"md-footer__direction">
2339 <div class=
"md-footer__button md-icon">
2340 <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>
2346 <div class=
"md-footer-meta md-typeset">
2347 <div class=
"md-footer-meta__inner md-grid">
2348 <div class=
"md-footer-copyright">
2350 <div class=
"md-footer-copyright__highlight">
2351 Copyright ©
2020 WoltLab GmbH
2355 <a href=
"https://squidfunk.github.io/mkdocs-material/" target=
"_blank" rel=
"noopener">
2360 <div class=
"md-footer-copyright">
2361 <a href=
"https://www.woltlab.com/legal-notice/">Legal Notice
</a>
2362 <a href=
"https://www.woltlab.com/privacy-policy/">Privacy Policy
</a>
2369 <div class=
"md-dialog" data-md-component=
"dialog">
2370 <div class=
"md-dialog__inner md-typeset"></div>
2372 <script id=
"__config" type=
"application/json">{
"base":
"..",
"features": [],
"translations": {
"clipboard.copy":
"Copy to clipboard",
"clipboard.copied":
"Copied to clipboard",
"search.config.lang":
"en",
"search.config.pipeline":
"trimmer, stopWordFilter",
"search.config.separator":
"[\\s\\-]+",
"search.placeholder":
"Search",
"search.result.placeholder":
"Type to start searching",
"search.result.none":
"No matching documents",
"search.result.one":
"1 matching document",
"search.result.other":
"# matching documents",
"search.result.more.one":
"1 more on this page",
"search.result.more.other":
"# more on this page",
"search.result.term.missing":
"Missing"},
"search":
"../assets/javascripts/workers/search.fe42c31b.min.js",
"version": {
"provider":
"mike"}}
</script>
2375 <script src=
"../assets/javascripts/bundle.d892486b.min.js"></script>