Deployed 901748f to 5.4 with MkDocs 1.1.2 and mike 0.5.5
[GitHub/WoltLab/woltlab.github.io.git] / latest / getting-started / index.html
CommitLineData
0c5338dd
TD
1
2<!doctype html>
3<html lang="en" class="no-js">
4 <head>
5
6 <meta charset="utf-8">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
8
9
10
11
fb962f09
WG
12 <link rel="icon" href="../assets/default.favicon.ico">
13 <meta name="generator" content="mkdocs-1.1.2, mkdocs-material-7.1.0">
0c5338dd
TD
14
15
16
17 <title>Getting Started - WoltLab Suite Documentation</title>
18
19
20
fb962f09 21 <link rel="stylesheet" href="../assets/stylesheets/main.33e2939f.min.css">
0c5338dd
TD
22
23
fb962f09 24 <link rel="stylesheet" href="../assets/stylesheets/palette.ef6f36e2.min.css">
0c5338dd
TD
25
26
27
28 <meta name="theme-color" content="#009485">
29
30
31
32
33
fd8430cb
WG
34
35
0c5338dd
TD
36
37
38 <link rel="stylesheet" href="../stylesheets/extra.css">
39
40
41
42
43
44 </head>
45
46
47
48
49
50
51
52 <body dir="ltr" data-md-color-scheme="" data-md-color-primary="teal" data-md-color-accent="">
0c5338dd
TD
53
54
fb962f09
WG
55 <script>function __prefix(e){return new URL("..",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
56
0c5338dd
TD
57 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
58 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
59 <label class="md-overlay" for="__drawer"></label>
60 <div data-md-component="skip">
61
62
63 <a href="#creating-a-simple-package" class="md-skip">
64 Skip to content
65 </a>
66
67 </div>
68 <div data-md-component="announce">
69
70 <aside class="md-announce">
71 <div class="md-announce__inner md-grid md-typeset">
72
73 <a href="https://www.woltlab.com">Back to <strong>woltlab.com</strong></a>
74
75 </div>
76 </aside>
77
78 </div>
79
fb962f09 80 <header class="md-header" data-md-component="header">
0c5338dd 81 <nav class="md-header__inner md-grid" aria-label="Header">
fb962f09 82 <a href=".." title="WoltLab Suite Documentation" class="md-header__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
0c5338dd
TD
83
84 <img src="../assets/logo.png" alt="logo">
85
86 </a>
87 <label class="md-header__button md-icon" for="__drawer">
88 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
89 </label>
90 <div class="md-header__title" data-md-component="header-title">
91 <div class="md-header__ellipsis">
92 <div class="md-header__topic">
93 <span class="md-ellipsis">
94 WoltLab Suite Documentation
95 </span>
96 </div>
97 <div class="md-header__topic" data-md-component="header-topic">
98 <span class="md-ellipsis">
99
100 Getting Started
101
102 </span>
103 </div>
104 </div>
0c5338dd
TD
105 </div>
106
fb962f09
WG
107
108
a3639e76
WG
109 <label class="md-header__button md-icon" for="__search">
110 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
111 </label>
112
113<div class="md-search" data-md-component="search" role="dialog">
114 <label class="md-search__overlay" for="__search"></label>
115 <div class="md-search__inner" role="search">
116 <form class="md-search__form" name="search">
117 <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
118 <label class="md-search__icon md-icon" for="__search">
119 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
120 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
121 </label>
122 <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
fb962f09 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>
a3639e76
WG
124 </button>
125 </form>
126 <div class="md-search__output">
127 <div class="md-search__scrollwrap" data-md-scrollfix>
128 <div class="md-search-result" data-md-component="search-result">
129 <div class="md-search-result__meta">
130 Initializing search
131 </div>
132 <ol class="md-search-result__list"></ol>
133 </div>
134 </div>
135 </div>
136 </div>
137</div>
138
0c5338dd 139
7124f4cb
WG
140 <div class="md-header__source">
141
142<a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
143 <div class="md-source__icon md-icon">
144
fb962f09 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>
7124f4cb
WG
146 </div>
147 <div class="md-source__repository">
148 GitHub
149 </div>
150</a>
151 </div>
152
0c5338dd
TD
153 </nav>
154</header>
155
156 <div class="md-container" data-md-component="container">
157
158
159
160
161 <main class="md-main" data-md-component="main">
162 <div class="md-main__inner md-grid">
163
164
165
166 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
167 <div class="md-sidebar__scrollwrap">
168 <div class="md-sidebar__inner">
169
170
171
0c5338dd
TD
172<nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
173 <label class="md-nav__title" for="__drawer">
fb962f09 174 <a href=".." title="WoltLab Suite Documentation" class="md-nav__button md-logo" aria-label="WoltLab Suite Documentation" data-md-component="logo">
0c5338dd
TD
175
176 <img src="../assets/logo.png" alt="logo">
177
178 </a>
179 WoltLab Suite Documentation
180 </label>
181
7124f4cb
WG
182 <div class="md-nav__source">
183
184<a href="https://github.com/WoltLab/docs.woltlab.com/" title="Go to repository" class="md-source" data-md-component="source">
185 <div class="md-source__icon md-icon">
186
fb962f09 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>
7124f4cb
WG
188 </div>
189 <div class="md-source__repository">
190 GitHub
191 </div>
192</a>
193 </div>
194
0c5338dd
TD
195 <ul class="md-nav__list" data-md-scrollfix>
196
197
198
199
200
201
202
203
204
205
206 <li class="md-nav__item md-nav__item--active">
207
208 <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
209
210
211
212
213 <label class="md-nav__link md-nav__link--active" for="__toc">
214 Getting Started
215 <span class="md-nav__icon md-icon"></span>
216 </label>
217
218 <a href="./" class="md-nav__link md-nav__link--active">
219 Getting Started
220 </a>
221
222
223<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
224
225
226
227
228
229 <label class="md-nav__title" for="__toc">
230 <span class="md-nav__icon md-icon"></span>
231 Table of contents
232 </label>
233 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
234
235 <li class="md-nav__item">
236 <a href="#setup-and-requirements" class="md-nav__link">
237 Setup and Requirements
238 </a>
239
240</li>
241
242 <li class="md-nav__item">
243 <a href="#the-packagexml-file" class="md-nav__link">
244 The package.xml File
245 </a>
246
247</li>
248
249 <li class="md-nav__item">
250 <a href="#the-php-class" class="md-nav__link">
251 The PHP Class
252 </a>
253
254</li>
255
256 <li class="md-nav__item">
257 <a href="#the-template" class="md-nav__link">
258 The Template
259 </a>
260
261</li>
262
263 <li class="md-nav__item">
264 <a href="#the-page-definition" class="md-nav__link">
265 The Page Definition
266 </a>
267
268</li>
269
270 <li class="md-nav__item">
271 <a href="#building-the-package" class="md-nav__link">
272 Building the Package
273 </a>
274
275</li>
276
277 <li class="md-nav__item">
278 <a href="#installation" class="md-nav__link">
279 Installation
280 </a>
281
282</li>
283
284 <li class="md-nav__item">
285 <a href="#developer-tools" class="md-nav__link">
286 Developer Tools
287 </a>
288
289 <nav class="md-nav" aria-label="Developer Tools">
290 <ul class="md-nav__list">
291
292 <li class="md-nav__item">
293 <a href="#registering-a-project" class="md-nav__link">
294 Registering a Project
295 </a>
296
297</li>
298
299 <li class="md-nav__item">
300 <a href="#synchronizing" class="md-nav__link">
301 Synchronizing
302 </a>
303
304</li>
305
306 </ul>
307 </nav>
308
309</li>
310
311 <li class="md-nav__item">
312 <a href="#appendix" class="md-nav__link">
313 Appendix
314 </a>
315
316 <nav class="md-nav" aria-label="Appendix">
317 <ul class="md-nav__list">
318
319 <li class="md-nav__item">
320 <a href="#template-guessing" class="md-nav__link">
321 Template Guessing
322 </a>
323
324</li>
325
326 </ul>
327 </nav>
328
329</li>
330
331 </ul>
332
333</nav>
334
335 </li>
336
337
338
339
340
341
342
343
344
345
346
347 <li class="md-nav__item md-nav__item--nested">
348
349
350 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2" type="checkbox" id="__nav_2" >
351
352 <label class="md-nav__link" for="__nav_2">
353 PHP API
354 <span class="md-nav__icon md-icon"></span>
355 </label>
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>
359 PHP API
360 </label>
361 <ul class="md-nav__list" data-md-scrollfix>
362
363
364
365
366
367 <li class="md-nav__item">
368 <a href="../php/pages/" class="md-nav__link">
369 Pages
370 </a>
371 </li>
372
373
374
375
376
377
378
379 <li class="md-nav__item">
380 <a href="../php/database-objects/" class="md-nav__link">
381 Database Objects
382 </a>
383 </li>
384
385
386
387
388
389
390
391 <li class="md-nav__item">
392 <a href="../php/database-access/" class="md-nav__link">
393 Database Access
394 </a>
395 </li>
396
397
398
399
400
401
402
403 <li class="md-nav__item">
404 <a href="../php/exceptions/" class="md-nav__link">
405 Exceptions
406 </a>
407 </li>
408
409
410
411
412
413
414
415
416 <li class="md-nav__item md-nav__item--nested">
417
418
419 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5" type="checkbox" id="__nav_2_5" >
420
421 <label class="md-nav__link" for="__nav_2_5">
422 API
423 <span class="md-nav__icon md-icon"></span>
424 </label>
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>
428 API
429 </label>
430 <ul class="md-nav__list" data-md-scrollfix>
431
432
433
434
435
436 <li class="md-nav__item">
437 <a href="../php/api/caches/" class="md-nav__link">
438 Caches
439 </a>
440 </li>
441
442
443
444
445
446
447
448 <li class="md-nav__item">
449 <a href="../php/api/comments/" class="md-nav__link">
450 Comments
451 </a>
452 </li>
453
454
455
456
457
458
459
460 <li class="md-nav__item">
461 <a href="../php/api/cronjobs/" class="md-nav__link">
462 Cronjobs
463 </a>
464 </li>
465
466
467
468
469
470
471
472 <li class="md-nav__item">
473 <a href="../php/api/events/" class="md-nav__link">
474 Events
475 </a>
476 </li>
477
478
479
480
481
482
483
484
485 <li class="md-nav__item md-nav__item--nested">
486
487
488 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_2_5_5" type="checkbox" id="__nav_2_5_5" >
489
490 <label class="md-nav__link" for="__nav_2_5_5">
491 Form Builder
492 <span class="md-nav__icon md-icon"></span>
493 </label>
494 <nav class="md-nav" aria-label="Form Builder" data-md-level="3">
495 <label class="md-nav__title" for="__nav_2_5_5">
496 <span class="md-nav__icon md-icon"></span>
497 Form Builder
498 </label>
499 <ul class="md-nav__list" data-md-scrollfix>
500
501
502
503
504
505 <li class="md-nav__item">
506 <a href="../php/api/form_builder/overview/" class="md-nav__link">
507 Overview
508 </a>
509 </li>
510
511
512
513
514
515
516
517 <li class="md-nav__item">
518 <a href="../php/api/form_builder/structure/" class="md-nav__link">
519 Structure
520 </a>
521 </li>
522
523
524
525
526
527
528
529 <li class="md-nav__item">
530 <a href="../php/api/form_builder/form_fields/" class="md-nav__link">
531 Fields
532 </a>
533 </li>
534
535
536
537
538
539
540
541 <li class="md-nav__item">
542 <a href="../php/api/form_builder/validation_data/" class="md-nav__link">
543 Validation and Data
544 </a>
545 </li>
546
547
548
549
550
551
552
553 <li class="md-nav__item">
554 <a href="../php/api/form_builder/dependencies/" class="md-nav__link">
555 Dependencies
556 </a>
557 </li>
558
559
560
561 </ul>
562 </nav>
563 </li>
564
565
566
567
568
569
570
571 <li class="md-nav__item">
572 <a href="../php/api/package_installation_plugins/" class="md-nav__link">
573 Package Installation Plugins
574 </a>
575 </li>
576
577
578
579
580
581
582
583 <li class="md-nav__item">
584 <a href="../php/api/user_activity_points/" class="md-nav__link">
585 User Activity Points
586 </a>
587 </li>
588
589
590
591
592
593
594
595 <li class="md-nav__item">
596 <a href="../php/api/user_notifications/" class="md-nav__link">
597 User Notifications
598 </a>
599 </li>
600
601
602
603
604
605
606
607 <li class="md-nav__item">
608 <a href="../php/api/sitemaps/" class="md-nav__link">
609 Sitemaps
610 </a>
611 </li>
612
613
614
615 </ul>
616 </nav>
617 </li>
618
619
620
621
622
623
624
625 <li class="md-nav__item">
626 <a href="../php/code-style/" class="md-nav__link">
627 Code Style
628 </a>
629 </li>
630
631
632
633
634
635
636
637 <li class="md-nav__item">
638 <a href="../php/apps/" class="md-nav__link">
639 Apps
640 </a>
641 </li>
642
643
644
645
646
647
648
649 <li class="md-nav__item">
650 <a href="../php/gdpr/" class="md-nav__link">
651 GDPR
652 </a>
653 </li>
654
655
656
657 </ul>
658 </nav>
659 </li>
660
661
662
663
664
665
666
667
668
669
670
671 <li class="md-nav__item md-nav__item--nested">
672
673
674 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
675
676 <label class="md-nav__link" for="__nav_3">
677 Languages, Templates & CSS
678 <span class="md-nav__icon md-icon"></span>
679 </label>
680 <nav class="md-nav" aria-label="Languages, Templates & CSS" data-md-level="1">
681 <label class="md-nav__title" for="__nav_3">
682 <span class="md-nav__icon md-icon"></span>
683 Languages, Templates & CSS
684 </label>
685 <ul class="md-nav__list" data-md-scrollfix>
686
687
688
689
690
691 <li class="md-nav__item">
692 <a href="../view/languages/" class="md-nav__link">
693 Languages
694 </a>
695 </li>
696
697
698
699
700
701
702
703 <li class="md-nav__item">
704 <a href="../view/templates/" class="md-nav__link">
705 Templates
706 </a>
707 </li>
708
709
710
711
712
713
714
715 <li class="md-nav__item">
716 <a href="../view/css/" class="md-nav__link">
717 CSS
718 </a>
719 </li>
720
721
722
723 </ul>
724 </nav>
725 </li>
726
727
728
729
730
731
732
733
734
735
736
737 <li class="md-nav__item md-nav__item--nested">
738
739
740 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
741
742 <label class="md-nav__link" for="__nav_4">
77efcd46 743 TypeScript and JavaScript API
0c5338dd
TD
744 <span class="md-nav__icon md-icon"></span>
745 </label>
77efcd46 746 <nav class="md-nav" aria-label="TypeScript and JavaScript API" data-md-level="1">
0c5338dd
TD
747 <label class="md-nav__title" for="__nav_4">
748 <span class="md-nav__icon md-icon"></span>
77efcd46 749 TypeScript and JavaScript API
0c5338dd
TD
750 </label>
751 <ul class="md-nav__list" data-md-scrollfix>
752
753
754
755
756
757 <li class="md-nav__item">
758 <a href="../javascript/general-usage/" class="md-nav__link">
759 General Usage
760 </a>
761 </li>
762
763
764
765
766
767
768
77efcd46
WG
769 <li class="md-nav__item">
770 <a href="../javascript/typescript/" class="md-nav__link">
771 TypeScript
772 </a>
773 </li>
774
775
776
777
778
779
780
0c5338dd
TD
781
782 <li class="md-nav__item md-nav__item--nested">
783
784
77efcd46 785 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_3" type="checkbox" id="__nav_4_3" >
0c5338dd 786
77efcd46 787 <label class="md-nav__link" for="__nav_4_3">
0c5338dd
TD
788 New API
789 <span class="md-nav__icon md-icon"></span>
790 </label>
791 <nav class="md-nav" aria-label="New API" data-md-level="2">
77efcd46 792 <label class="md-nav__title" for="__nav_4_3">
0c5338dd
TD
793 <span class="md-nav__icon md-icon"></span>
794 New API
795 </label>
796 <ul class="md-nav__list" data-md-scrollfix>
797
798
799
800
801
802 <li class="md-nav__item">
803 <a href="../javascript/new-api_writing-a-module/" class="md-nav__link">
804 Writing a module
805 </a>
806 </li>
807
808
809
810
811
812
813
814 <li class="md-nav__item">
815 <a href="../javascript/new-api_data-structures/" class="md-nav__link">
816 Data Structures
817 </a>
818 </li>
819
820
821
822
823
824
825
826 <li class="md-nav__item">
827 <a href="../javascript/new-api_core/" class="md-nav__link">
828 Core Functions
829 </a>
830 </li>
831
832
833
834
835
836
837
838 <li class="md-nav__item">
839 <a href="../javascript/new-api_dom/" class="md-nav__link">
840 DOM
841 </a>
842 </li>
843
844
845
846
847
848
849
850 <li class="md-nav__item">
851 <a href="../javascript/new-api_events/" class="md-nav__link">
852 Event Handling
853 </a>
854 </li>
855
856
857
858
859
860
861
862 <li class="md-nav__item">
863 <a href="../javascript/new-api_ajax/" class="md-nav__link">
864 Ajax
865 </a>
866 </li>
867
868
869
870
871
872
873
874 <li class="md-nav__item">
875 <a href="../javascript/new-api_dialogs/" class="md-nav__link">
876 Dialogs
877 </a>
878 </li>
879
880
881
882
883
884
885
886 <li class="md-nav__item">
887 <a href="../javascript/new-api_browser/" class="md-nav__link">
888 Browser and Screen Sizes
889 </a>
890 </li>
891
892
893
894
895
896
897
898 <li class="md-nav__item">
899 <a href="../javascript/new-api_ui/" class="md-nav__link">
900 User Interface
901 </a>
902 </li>
903
904
905
906 </ul>
907 </nav>
908 </li>
909
910
911
912
913
914
915
916 <li class="md-nav__item">
917 <a href="../javascript/legacy-api/" class="md-nav__link">
918 Legacy API
919 </a>
920 </li>
921
922
923
924
925
926
927
928 <li class="md-nav__item">
929 <a href="../javascript/helper-functions/" class="md-nav__link">
930 Helper Functions
931 </a>
932 </li>
933
934
935
936
937
938
939
940 <li class="md-nav__item">
941 <a href="../javascript/code-snippets/" class="md-nav__link">
942 Code Snippets
943 </a>
944 </li>
945
946
947
948 </ul>
949 </nav>
950 </li>
951
952
953
954
955
956
957
958
959
960
961
962 <li class="md-nav__item md-nav__item--nested">
963
964
965 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
966
967 <label class="md-nav__link" for="__nav_5">
968 Package Components
969 <span class="md-nav__icon md-icon"></span>
970 </label>
971 <nav class="md-nav" aria-label="Package Components" data-md-level="1">
972 <label class="md-nav__title" for="__nav_5">
973 <span class="md-nav__icon md-icon"></span>
974 Package Components
975 </label>
976 <ul class="md-nav__list" data-md-scrollfix>
977
978
979
980
981
982 <li class="md-nav__item">
983 <a href="../package/package-xml/" class="md-nav__link">
984 package.xml
985 </a>
986 </li>
987
988
989
990
991
992
993
994
995 <li class="md-nav__item md-nav__item--nested">
996
997
998 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" >
999
1000 <label class="md-nav__link" for="__nav_5_2">
1001 PIPs
1002 <span class="md-nav__icon md-icon"></span>
1003 </label>
1004 <nav class="md-nav" aria-label="PIPs" data-md-level="2">
1005 <label class="md-nav__title" for="__nav_5_2">
1006 <span class="md-nav__icon md-icon"></span>
1007 PIPs
1008 </label>
1009 <ul class="md-nav__list" data-md-scrollfix>
1010
1011
1012
1013
1014
1015 <li class="md-nav__item">
1016 <a href="../package/pip/" class="md-nav__link">
1017 Overview
1018 </a>
1019 </li>
1020
1021
1022
1023
1024
1025
1026
1027 <li class="md-nav__item">
1028 <a href="../package/pip/acl-option/" class="md-nav__link">
1029 aclOption
1030 </a>
1031 </li>
1032
1033
1034
1035
1036
1037
1038
1039 <li class="md-nav__item">
1040 <a href="../package/pip/acp-menu/" class="md-nav__link">
1041 acpMenu
1042 </a>
1043 </li>
1044
1045
1046
1047
1048
1049
1050
1051 <li class="md-nav__item">
1052 <a href="../package/pip/acp-search-provider/" class="md-nav__link">
1053 acpSearchProvider
1054 </a>
1055 </li>
1056
1057
1058
1059
1060
1061
1062
1063 <li class="md-nav__item">
1064 <a href="../package/pip/acp-template/" class="md-nav__link">
1065 acpTemplate
1066 </a>
1067 </li>
1068
1069
1070
1071
1072
1073
1074
1075 <li class="md-nav__item">
1076 <a href="../package/pip/bbcode/" class="md-nav__link">
1077 bbcode
1078 </a>
1079 </li>
1080
1081
1082
1083
1084
1085
1086
1087 <li class="md-nav__item">
1088 <a href="../package/pip/box/" class="md-nav__link">
1089 box
1090 </a>
1091 </li>
1092
1093
1094
1095
1096
1097
1098
1099 <li class="md-nav__item">
1100 <a href="../package/pip/clipboard-action/" class="md-nav__link">
1101 clipboardAction
1102 </a>
1103 </li>
1104
1105
1106
1107
1108
1109
1110
1111 <li class="md-nav__item">
1112 <a href="../package/pip/core-object/" class="md-nav__link">
1113 coreObject
1114 </a>
1115 </li>
1116
1117
1118
1119
1120
1121
1122
1123 <li class="md-nav__item">
1124 <a href="../package/pip/cronjob/" class="md-nav__link">
1125 cronjob
1126 </a>
1127 </li>
1128
1129
1130
1131
1132
1133
1134
1135 <li class="md-nav__item">
1136 <a href="../package/pip/event-listener/" class="md-nav__link">
1137 eventListener
1138 </a>
1139 </li>
1140
1141
1142
1143
1144
1145
1146
1147 <li class="md-nav__item">
1148 <a href="../package/pip/file/" class="md-nav__link">
1149 file
1150 </a>
1151 </li>
1152
1153
1154
1155
1156
1157
1158
1159 <li class="md-nav__item">
1160 <a href="../package/pip/language/" class="md-nav__link">
1161 language
1162 </a>
1163 </li>
1164
1165
1166
1167
1168
1169
1170
1171 <li class="md-nav__item">
1172 <a href="../package/pip/media-provider/" class="md-nav__link">
1173 mediaProvider
1174 </a>
1175 </li>
1176
1177
1178
1179
1180
1181
1182
1183 <li class="md-nav__item">
1184 <a href="../package/pip/menu/" class="md-nav__link">
1185 menu
1186 </a>
1187 </li>
1188
1189
1190
1191
1192
1193
1194
1195 <li class="md-nav__item">
1196 <a href="../package/pip/menu-item/" class="md-nav__link">
1197 menuItem
1198 </a>
1199 </li>
1200
1201
1202
1203
1204
1205
1206
1207 <li class="md-nav__item">
1208 <a href="../package/pip/object-type/" class="md-nav__link">
1209 objectType
1210 </a>
1211 </li>
1212
1213
1214
1215
1216
1217
1218
1219 <li class="md-nav__item">
1220 <a href="../package/pip/object-type-definition/" class="md-nav__link">
1221 objectTypeDefinition
1222 </a>
1223 </li>
1224
1225
1226
1227
1228
1229
1230
1231 <li class="md-nav__item">
1232 <a href="../package/pip/option/" class="md-nav__link">
1233 option
1234 </a>
1235 </li>
1236
1237
1238
1239
1240
1241
1242
1243 <li class="md-nav__item">
1244 <a href="../package/pip/page/" class="md-nav__link">
1245 page
1246 </a>
1247 </li>
1248
1249
1250
1251
1252
1253
1254
1255 <li class="md-nav__item">
1256 <a href="../package/pip/pip/" class="md-nav__link">
1257 pip
1258 </a>
1259 </li>
1260
1261
1262
1263
1264
1265
1266
1267 <li class="md-nav__item">
1268 <a href="../package/pip/script/" class="md-nav__link">
1269 script
1270 </a>
1271 </li>
1272
1273
1274
1275
1276
1277
1278
1279 <li class="md-nav__item">
1280 <a href="../package/pip/smiley/" class="md-nav__link">
1281 smiley
1282 </a>
1283 </li>
1284
1285
1286
1287
1288
1289
1290
1291 <li class="md-nav__item">
1292 <a href="../package/pip/sql/" class="md-nav__link">
1293 sql
1294 </a>
1295 </li>
1296
1297
1298
1299
1300
1301
1302
1303 <li class="md-nav__item">
1304 <a href="../package/pip/style/" class="md-nav__link">
1305 style
1306 </a>
1307 </li>
1308
1309
1310
1311
1312
1313
1314
1315 <li class="md-nav__item">
1316 <a href="../package/pip/template/" class="md-nav__link">
1317 template
1318 </a>
1319 </li>
1320
1321
1322
1323
1324
1325
1326
1327 <li class="md-nav__item">
1328 <a href="../package/pip/template-listener/" class="md-nav__link">
1329 templateListener
1330 </a>
1331 </li>
1332
1333
1334
1335
1336
1337
1338
1339 <li class="md-nav__item">
1340 <a href="../package/pip/user-group-option/" class="md-nav__link">
1341 userGroupOption
1342 </a>
1343 </li>
1344
1345
1346
1347
1348
1349
1350
1351 <li class="md-nav__item">
1352 <a href="../package/pip/user-menu/" class="md-nav__link">
1353 userMenu
1354 </a>
1355 </li>
1356
1357
1358
1359
1360
1361
1362
1363 <li class="md-nav__item">
1364 <a href="../package/pip/user-notification-event/" class="md-nav__link">
1365 userNotificationEvent
1366 </a>
1367 </li>
1368
1369
1370
1371
1372
1373
1374
1375 <li class="md-nav__item">
1376 <a href="../package/pip/user-option/" class="md-nav__link">
1377 userOption
1378 </a>
1379 </li>
1380
1381
1382
1383
1384
1385
1386
1387 <li class="md-nav__item">
1388 <a href="../package/pip/user-profile-menu/" class="md-nav__link">
1389 userProfileMenu
1390 </a>
1391 </li>
1392
1393
1394
1395 </ul>
1396 </nav>
1397 </li>
1398
1399
1400
1401
1402
1403
1404
1405 <li class="md-nav__item">
1406 <a href="../package/database-php-api/" class="md-nav__link">
1407 Database PHP API
1408 </a>
1409 </li>
1410
1411
1412
1413 </ul>
1414 </nav>
1415 </li>
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427 <li class="md-nav__item md-nav__item--nested">
1428
1429
1430 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
1431
1432 <label class="md-nav__link" for="__nav_6">
1433 Migration
1434 <span class="md-nav__icon md-icon"></span>
1435 </label>
1436 <nav class="md-nav" aria-label="Migration" data-md-level="1">
1437 <label class="md-nav__title" for="__nav_6">
1438 <span class="md-nav__icon md-icon"></span>
1439 Migration
1440 </label>
1441 <ul class="md-nav__list" data-md-scrollfix>
1442
1443
1444
1445
1446
1447
1448 <li class="md-nav__item md-nav__item--nested">
1449
1450
1451 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_1" type="checkbox" id="__nav_6_1" >
1452
1453 <label class="md-nav__link" for="__nav_6_1">
1454 Migrating from WSC 5.3
1455 <span class="md-nav__icon md-icon"></span>
1456 </label>
1457 <nav class="md-nav" aria-label="Migrating from WSC 5.3" data-md-level="2">
1458 <label class="md-nav__title" for="__nav_6_1">
1459 <span class="md-nav__icon md-icon"></span>
1460 Migrating from WSC 5.3
1461 </label>
1462 <ul class="md-nav__list" data-md-scrollfix>
1463
1464
1465
1466
1467
1468 <li class="md-nav__item">
1469 <a href="../migration/wsc53/php/" class="md-nav__link">
1470 PHP API
1471 </a>
1472 </li>
1473
1474
1475
1476
1477
1478
1479
1480 <li class="md-nav__item">
1481 <a href="../migration/wsc53/session/" class="md-nav__link">
1482 Session Handling and Authentication
1483 </a>
1484 </li>
1485
1486
1487
1488
1489
1490
1491
1492 <li class="md-nav__item">
1493 <a href="../migration/wsc53/javascript/" class="md-nav__link">
77efcd46 1494 TypeScript and JavaScript
0c5338dd
TD
1495 </a>
1496 </li>
1497
1498
1499
1500
1501
1502
1503
1504 <li class="md-nav__item">
1505 <a href="../migration/wsc53/templates/" class="md-nav__link">
1506 Templates
1507 </a>
1508 </li>
1509
1510
1511
1512
1513
1514
1515
1516 <li class="md-nav__item">
1517 <a href="../migration/wsc53/libraries/" class="md-nav__link">
1518 Third Party Libraries
1519 </a>
1520 </li>
1521
1522
1523
1524 </ul>
1525 </nav>
1526 </li>
1527
1528
1529
1530
1531
1532
1533
1534
1535 <li class="md-nav__item md-nav__item--nested">
1536
1537
1538 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_2" type="checkbox" id="__nav_6_2" >
1539
1540 <label class="md-nav__link" for="__nav_6_2">
1541 Migrating from WSC 5.2
1542 <span class="md-nav__icon md-icon"></span>
1543 </label>
1544 <nav class="md-nav" aria-label="Migrating from WSC 5.2" data-md-level="2">
1545 <label class="md-nav__title" for="__nav_6_2">
1546 <span class="md-nav__icon md-icon"></span>
1547 Migrating from WSC 5.2
1548 </label>
1549 <ul class="md-nav__list" data-md-scrollfix>
1550
1551
1552
1553
1554
1555 <li class="md-nav__item">
1556 <a href="../migration/wsc52/php/" class="md-nav__link">
1557 PHP API
1558 </a>
1559 </li>
1560
1561
1562
1563
1564
1565
1566
1567 <li class="md-nav__item">
1568 <a href="../migration/wsc52/templates/" class="md-nav__link">
1569 Templates and Languages
1570 </a>
1571 </li>
1572
1573
1574
1575
1576
1577
1578
1579 <li class="md-nav__item">
1580 <a href="../migration/wsc52/libraries/" class="md-nav__link">
1581 Third Party Libraries
1582 </a>
1583 </li>
1584
1585
1586
1587 </ul>
1588 </nav>
1589 </li>
1590
1591
1592
1593
1594
1595
1596
1597
1598 <li class="md-nav__item md-nav__item--nested">
1599
1600
1601 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_3" type="checkbox" id="__nav_6_3" >
1602
1603 <label class="md-nav__link" for="__nav_6_3">
1604 Migrating from WSC 3.1
1605 <span class="md-nav__icon md-icon"></span>
1606 </label>
1607 <nav class="md-nav" aria-label="Migrating from WSC 3.1" data-md-level="2">
1608 <label class="md-nav__title" for="__nav_6_3">
1609 <span class="md-nav__icon md-icon"></span>
1610 Migrating from WSC 3.1
1611 </label>
1612 <ul class="md-nav__list" data-md-scrollfix>
1613
1614
1615
1616
1617
1618 <li class="md-nav__item">
1619 <a href="../migration/wsc31/php/" class="md-nav__link">
1620 PHP API
1621 </a>
1622 </li>
1623
1624
1625
1626 </ul>
1627 </nav>
1628 </li>
1629
1630
1631
1632
1633
1634
1635
1636
1637 <li class="md-nav__item md-nav__item--nested">
1638
1639
1640 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_4" type="checkbox" id="__nav_6_4" >
1641
1642 <label class="md-nav__link" for="__nav_6_4">
1643 Migrating from WSC 3.0
1644 <span class="md-nav__icon md-icon"></span>
1645 </label>
1646 <nav class="md-nav" aria-label="Migrating from WSC 3.0" data-md-level="2">
1647 <label class="md-nav__title" for="__nav_6_4">
1648 <span class="md-nav__icon md-icon"></span>
1649 Migrating from WSC 3.0
1650 </label>
1651 <ul class="md-nav__list" data-md-scrollfix>
1652
1653
1654
1655
1656
1657 <li class="md-nav__item">
1658 <a href="../migration/wsc30/php/" class="md-nav__link">
1659 PHP API
1660 </a>
1661 </li>
1662
1663
1664
1665
1666
1667
1668
1669 <li class="md-nav__item">
1670 <a href="../migration/wsc30/javascript/" class="md-nav__link">
1671 JavaScript API
1672 </a>
1673 </li>
1674
1675
1676
1677
1678
1679
1680
1681 <li class="md-nav__item">
1682 <a href="../migration/wsc30/templates/" class="md-nav__link">
1683 Templates
1684 </a>
1685 </li>
1686
1687
1688
1689
1690
1691
1692
1693 <li class="md-nav__item">
1694 <a href="../migration/wsc30/css/" class="md-nav__link">
1695 CSS
1696 </a>
1697 </li>
1698
1699
1700
1701
1702
1703
1704
1705 <li class="md-nav__item">
1706 <a href="../migration/wsc30/package/" class="md-nav__link">
1707 Package Components
1708 </a>
1709 </li>
1710
1711
1712
1713 </ul>
1714 </nav>
1715 </li>
1716
1717
1718
1719
1720
1721
1722
1723
1724 <li class="md-nav__item md-nav__item--nested">
1725
1726
1727 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_5" type="checkbox" id="__nav_6_5" >
1728
1729 <label class="md-nav__link" for="__nav_6_5">
1730 Migrating from WCF 2.1
1731 <span class="md-nav__icon md-icon"></span>
1732 </label>
1733 <nav class="md-nav" aria-label="Migrating from WCF 2.1" data-md-level="2">
1734 <label class="md-nav__title" for="__nav_6_5">
1735 <span class="md-nav__icon md-icon"></span>
1736 Migrating from WCF 2.1
1737 </label>
1738 <ul class="md-nav__list" data-md-scrollfix>
1739
1740
1741
1742
1743
1744 <li class="md-nav__item">
1745 <a href="../migration/wcf21/php/" class="md-nav__link">
1746 PHP API
1747 </a>
1748 </li>
1749
1750
1751
1752
1753
1754
1755
1756 <li class="md-nav__item">
1757 <a href="../migration/wcf21/templates/" class="md-nav__link">
1758 Templates
1759 </a>
1760 </li>
1761
1762
1763
1764
1765
1766
1767
1768 <li class="md-nav__item">
1769 <a href="../migration/wcf21/css/" class="md-nav__link">
1770 CSS
1771 </a>
1772 </li>
1773
1774
1775
1776
1777
1778
1779
1780 <li class="md-nav__item">
1781 <a href="../migration/wcf21/package/" class="md-nav__link">
1782 Package Components
1783 </a>
1784 </li>
1785
1786
1787
1788 </ul>
1789 </nav>
1790 </li>
1791
1792
1793
1794 </ul>
1795 </nav>
1796 </li>
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808 <li class="md-nav__item md-nav__item--nested">
1809
1810
1811 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
1812
1813 <label class="md-nav__link" for="__nav_7">
1814 Tutorials
1815 <span class="md-nav__icon md-icon"></span>
1816 </label>
1817 <nav class="md-nav" aria-label="Tutorials" data-md-level="1">
1818 <label class="md-nav__title" for="__nav_7">
1819 <span class="md-nav__icon md-icon"></span>
1820 Tutorials
1821 </label>
1822 <ul class="md-nav__list" data-md-scrollfix>
1823
1824
1825
1826
1827
1828
1829 <li class="md-nav__item md-nav__item--nested">
1830
1831
1832 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_1" type="checkbox" id="__nav_7_1" >
1833
1834 <label class="md-nav__link" for="__nav_7_1">
1835 Tutorial Series
1836 <span class="md-nav__icon md-icon"></span>
1837 </label>
1838 <nav class="md-nav" aria-label="Tutorial Series" data-md-level="2">
1839 <label class="md-nav__title" for="__nav_7_1">
1840 <span class="md-nav__icon md-icon"></span>
1841 Tutorial Series
1842 </label>
1843 <ul class="md-nav__list" data-md-scrollfix>
1844
1845
1846
1847
1848
1849 <li class="md-nav__item">
1850 <a href="../tutorial/series/overview/" class="md-nav__link">
1851 Overview
1852 </a>
1853 </li>
1854
1855
1856
1857
1858
1859
1860
1861 <li class="md-nav__item">
1862 <a href="../tutorial/series/part_1/" class="md-nav__link">
1863 Part 1
1864 </a>
1865 </li>
1866
1867
1868
1869
1870
1871
1872
1873 <li class="md-nav__item">
1874 <a href="../tutorial/series/part_2/" class="md-nav__link">
1875 Part 2
1876 </a>
1877 </li>
1878
1879
1880
1881
1882
1883
1884
1885 <li class="md-nav__item">
1886 <a href="../tutorial/series/part_3/" class="md-nav__link">
1887 Part 3
1888 </a>
1889 </li>
1890
1891
1892
1893 </ul>
1894 </nav>
1895 </li>
1896
1897
1898
1899 </ul>
1900 </nav>
1901 </li>
1902
1903
1904
1905 </ul>
1906</nav>
1907 </div>
1908 </div>
1909 </div>
1910
1911
1912
1913 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
1914 <div class="md-sidebar__scrollwrap">
1915 <div class="md-sidebar__inner">
1916
1917<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
1918
1919
1920
1921
1922
1923 <label class="md-nav__title" for="__toc">
1924 <span class="md-nav__icon md-icon"></span>
1925 Table of contents
1926 </label>
1927 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
1928
1929 <li class="md-nav__item">
1930 <a href="#setup-and-requirements" class="md-nav__link">
1931 Setup and Requirements
1932 </a>
1933
1934</li>
1935
1936 <li class="md-nav__item">
1937 <a href="#the-packagexml-file" class="md-nav__link">
1938 The package.xml File
1939 </a>
1940
1941</li>
1942
1943 <li class="md-nav__item">
1944 <a href="#the-php-class" class="md-nav__link">
1945 The PHP Class
1946 </a>
1947
1948</li>
1949
1950 <li class="md-nav__item">
1951 <a href="#the-template" class="md-nav__link">
1952 The Template
1953 </a>
1954
1955</li>
1956
1957 <li class="md-nav__item">
1958 <a href="#the-page-definition" class="md-nav__link">
1959 The Page Definition
1960 </a>
1961
1962</li>
1963
1964 <li class="md-nav__item">
1965 <a href="#building-the-package" class="md-nav__link">
1966 Building the Package
1967 </a>
1968
1969</li>
1970
1971 <li class="md-nav__item">
1972 <a href="#installation" class="md-nav__link">
1973 Installation
1974 </a>
1975
1976</li>
1977
1978 <li class="md-nav__item">
1979 <a href="#developer-tools" class="md-nav__link">
1980 Developer Tools
1981 </a>
1982
1983 <nav class="md-nav" aria-label="Developer Tools">
1984 <ul class="md-nav__list">
1985
1986 <li class="md-nav__item">
1987 <a href="#registering-a-project" class="md-nav__link">
1988 Registering a Project
1989 </a>
1990
1991</li>
1992
1993 <li class="md-nav__item">
1994 <a href="#synchronizing" class="md-nav__link">
1995 Synchronizing
1996 </a>
1997
1998</li>
1999
2000 </ul>
2001 </nav>
2002
2003</li>
2004
2005 <li class="md-nav__item">
2006 <a href="#appendix" class="md-nav__link">
2007 Appendix
2008 </a>
2009
2010 <nav class="md-nav" aria-label="Appendix">
2011 <ul class="md-nav__list">
2012
2013 <li class="md-nav__item">
2014 <a href="#template-guessing" class="md-nav__link">
2015 Template Guessing
2016 </a>
2017
2018</li>
2019
2020 </ul>
2021 </nav>
2022
2023</li>
2024
2025 </ul>
2026
2027</nav>
2028 </div>
2029 </div>
2030 </div>
2031
2032
2033 <div class="md-content" data-md-component="content">
2034 <article class="md-content__inner md-typeset">
2035
2036
9b8bddda 2037 <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">
7124f4cb
WG
2038 <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>
2039 </a>
2040
0c5338dd
TD
2041
2042 <h1 id="creating-a-simple-package">Creating a simple package<a class="headerlink" href="#creating-a-simple-package" title="Permanent link">#</a></h1>
2043<h2 id="setup-and-requirements">Setup and Requirements<a class="headerlink" href="#setup-and-requirements" title="Permanent link">#</a></h2>
2044<p>This guide will help you to create a simple package that provides a simple test
2045page. It is nothing too fancy, but you can use it as the foundation for your
2046next project.</p>
2047<p>There are some requirements you should met before starting:</p>
2048<ul>
2049<li>Text editor with syntax highlighting for PHP, <a href="https://notepad-plus-plus.org/">Notepad++</a> is a solid pick</li>
2050<li><code>*.php</code> and <code>*.tpl</code> should be encoded with ANSI/ASCII</li>
2051<li><code>*.xml</code> are always encoded with UTF-8, but omit the BOM (byte-order-mark)</li>
2052<li>Use tabs instead of spaces to indent lines</li>
2053<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>
2054<li>An active installation of WoltLab Suite 3</li>
2055<li>An application to create <code>*.tar</code> archives, e.g. <a href="http://www.7-zip.org/">7-Zip</a> on Windows</li>
2056</ul>
2057<h2 id="the-packagexml-file">The package.xml File<a class="headerlink" href="#the-packagexml-file" title="Permanent link">#</a></h2>
2058<p>We want to create a simple page that will display the sentence "Hello World" embedded
2059into the application frame. Create an empty directory in the workspace of your choice
2060to start with.</p>
2061<p>Create a new file called <code>package.xml</code> and insert the code below:</p>
2062<div class="highlight"><pre><span></span><code><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
2063<span class="nt">&lt;package</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.woltlab.com&quot;</span> <span class="na">xmlns:xsi=</span><span class="s">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span class="na">xsi:schemaLocation=</span><span class="s">&quot;http://www.woltlab.com http://www.woltlab.com/XSD/2019/package.xsd&quot;</span> <span class="na">name=</span><span class="s">&quot;com.example.test&quot;</span><span class="nt">&gt;</span>
2064 <span class="nt">&lt;packageinformation&gt;</span>
2065 <span class="c">&lt;!-- com.example.test --&gt;</span>
2066 <span class="nt">&lt;packagename&gt;</span>Simple Package<span class="nt">&lt;/packagename&gt;</span>
2067 <span class="nt">&lt;packagedescription&gt;</span>A simple package to demonstrate the package system of WoltLab Suite Core<span class="nt">&lt;/packagedescription&gt;</span>
2068 <span class="nt">&lt;version&gt;</span>1.0.0<span class="nt">&lt;/version&gt;</span>
2069 <span class="nt">&lt;date&gt;</span>2019-04-28<span class="nt">&lt;/date&gt;</span>
2070 <span class="nt">&lt;/packageinformation&gt;</span>
2071 <span class="nt">&lt;authorinformation&gt;</span>
2072 <span class="nt">&lt;author&gt;</span>Your Name<span class="nt">&lt;/author&gt;</span>
2073 <span class="nt">&lt;authorurl&gt;</span>http://www.example.com<span class="nt">&lt;/authorurl&gt;</span>
2074 <span class="nt">&lt;/authorinformation&gt;</span>
2075 <span class="nt">&lt;excludedpackages&gt;</span>
2076 <span class="nt">&lt;excludedpackage</span> <span class="na">version=</span><span class="s">&quot;6.0.0 Alpha 1&quot;</span><span class="nt">&gt;</span>com.woltlab.wcf<span class="nt">&lt;/excludedpackage&gt;</span>
2077 <span class="nt">&lt;/excludedpackages&gt;</span>
2078 <span class="nt">&lt;instructions</span> <span class="na">type=</span><span class="s">&quot;install&quot;</span><span class="nt">&gt;</span>
2079 <span class="nt">&lt;instruction</span> <span class="na">type=</span><span class="s">&quot;file&quot;</span> <span class="nt">/&gt;</span>
2080 <span class="nt">&lt;instruction</span> <span class="na">type=</span><span class="s">&quot;template&quot;</span> <span class="nt">/&gt;</span>
2081 <span class="nt">&lt;instruction</span> <span class="na">type=</span><span class="s">&quot;page&quot;</span> <span class="nt">/&gt;</span>
2082 <span class="nt">&lt;/instructions&gt;</span>
2083<span class="nt">&lt;/package&gt;</span>
2084</code></pre></div>
0c5338dd
TD
2085<p>There is an <a href="../package/package-xml/">entire chapter</a> on the package system that explains what the code above
2086does and how you can adjust it to fit your needs. For now we'll keep it as it is.</p>
2087<h2 id="the-php-class">The PHP Class<a class="headerlink" href="#the-php-class" title="Permanent link">#</a></h2>
2088<p>The next step is to create the PHP class which will serve our page:</p>
2089<ol>
2090<li>Create the directory <code>files</code> in the same directory where <code>package.xml</code> is located</li>
2091<li>Open <code>files</code> and create the directory <code>lib</code></li>
2092<li>Open <code>lib</code> and create the directory <code>page</code></li>
2093<li>Within the directory <code>page</code>, please create the file <code>TestPage.class.php</code></li>
2094</ol>
2095<p>Copy and paste the following code into the <code>TestPage.class.php</code>:</p>
2096<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2097<span class="k">namespace</span> <span class="nx">wcf\page</span><span class="p">;</span>
2098<span class="k">use</span> <span class="nx">wcf\system\WCF</span><span class="p">;</span>
2099
2100<span class="sd">/**</span>
2101<span class="sd"> * A simple test page for demonstration purposes.</span>
2102<span class="sd"> *</span>
2103<span class="sd"> * @author YOUR NAME</span>
2104<span class="sd"> * @license GNU Lesser General Public License &lt;http://opensource.org/licenses/lgpl-license.php&gt;</span>
2105<span class="sd"> */</span>
2106<span class="k">class</span> <span class="nc">TestPage</span> <span class="k">extends</span> <span class="nx">AbstractPage</span> <span class="p">{</span>
2107 <span class="sd">/**</span>
2108<span class="sd"> * @var string</span>
2109<span class="sd"> */</span>
2110 <span class="k">protected</span> <span class="nv">$greet</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
2111
2112 <span class="sd">/**</span>
2113<span class="sd"> * @inheritDoc</span>
2114<span class="sd"> */</span>
2115 <span class="k">public</span> <span class="k">function</span> <span class="nf">readParameters</span><span class="p">()</span> <span class="p">{</span>
2116 <span class="k">parent</span><span class="o">::</span><span class="na">readParameters</span><span class="p">();</span>
2117
2118 <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">&#39;greet&#39;</span><span class="p">]))</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">greet</span> <span class="o">=</span> <span class="nv">$_GET</span><span class="p">[</span><span class="s1">&#39;greet&#39;</span><span class="p">];</span>
2119 <span class="p">}</span>
2120
2121 <span class="sd">/**</span>
2122<span class="sd"> * @inheritDoc</span>
2123<span class="sd"> */</span>
2124 <span class="k">public</span> <span class="k">function</span> <span class="nf">readData</span><span class="p">()</span> <span class="p">{</span>
2125 <span class="k">parent</span><span class="o">::</span><span class="na">readData</span><span class="p">();</span>
2126
2127 <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">-&gt;</span><span class="na">greet</span><span class="p">))</span> <span class="p">{</span>
2128 <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">greet</span> <span class="o">=</span> <span class="s1">&#39;World&#39;</span><span class="p">;</span>
2129 <span class="p">}</span>
2130 <span class="p">}</span>
2131
2132 <span class="sd">/**</span>
2133<span class="sd"> * @inheritDoc</span>
2134<span class="sd"> */</span>
2135 <span class="k">public</span> <span class="k">function</span> <span class="nf">assignVariables</span><span class="p">()</span> <span class="p">{</span>
2136 <span class="k">parent</span><span class="o">::</span><span class="na">assignVariables</span><span class="p">();</span>
2137
2138 <span class="nx">WCF</span><span class="o">::</span><span class="na">getTPL</span><span class="p">()</span><span class="o">-&gt;</span><span class="na">assign</span><span class="p">([</span>
2139 <span class="s1">&#39;greet&#39;</span> <span class="o">=&gt;</span> <span class="nv">$this</span><span class="o">-&gt;</span><span class="na">greet</span>
2140 <span class="p">]);</span>
2141 <span class="p">}</span>
2142<span class="p">}</span>
2143</code></pre></div>
0c5338dd
TD
2144<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
2145defines 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>
2146<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/&amp;greet=You</code> would output <code>Hello You!</code>). This extra code illustrates the separation of data
2147processing 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
2148start 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>
2149<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
2150namespace and class name, you can <a href="#template-guessing">read more about it later</a>.</p>
2151<p>Last but not least, you must not include the closing PHP tag <code>?&gt;</code> at the end, it can cause PHP to break on whitespaces and is not required at all.</p>
2152<h2 id="the-template">The Template<a class="headerlink" href="#the-template" title="Permanent link">#</a></h2>
2153<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>
2154<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">&#39;header&#39;</span><span class="cp">}</span><span class="x"></span>
2155
2156<span class="x">&lt;div class=&quot;section&quot;&gt;</span>
2157<span class="x"> Hello </span><span class="cp">{</span><span class="nv">$greet</span><span class="cp">}</span><span class="x">!</span>
2158<span class="x">&lt;/div&gt;</span>
2159
2160<span class="cp">{</span><span class="nf">include</span> <span class="na">file</span><span class="o">=</span><span class="s1">&#39;footer&#39;</span><span class="cp">}</span><span class="x"></span>
2161</code></pre></div>
0c5338dd
TD
2162<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
2163page 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>
2164<h2 id="the-page-definition">The Page Definition<a class="headerlink" href="#the-page-definition" title="Permanent link">#</a></h2>
2165<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>
2166<div class="highlight"><pre><span></span><code><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
2167<span class="nt">&lt;data</span> <span class="na">xmlns=</span><span class="s">&quot;http://www.woltlab.com&quot;</span> <span class="na">xmlns:xsi=</span><span class="s">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span> <span class="na">xsi:schemaLocation=</span><span class="s">&quot;http://www.woltlab.com http://www.woltlab.com/XSD/2019/page.xsd&quot;</span><span class="nt">&gt;</span>
2168 <span class="nt">&lt;import&gt;</span>
2169 <span class="nt">&lt;page</span> <span class="na">identifier=</span><span class="s">&quot;com.example.test.Test&quot;</span><span class="nt">&gt;</span>
2170 <span class="nt">&lt;controller&gt;</span>wcf\page\TestPage<span class="nt">&lt;/controller&gt;</span>
2171 <span class="nt">&lt;name</span> <span class="na">language=</span><span class="s">&quot;en&quot;</span><span class="nt">&gt;</span>Test Page<span class="nt">&lt;/name&gt;</span>
2172 <span class="nt">&lt;pageType&gt;</span>system<span class="nt">&lt;/pageType&gt;</span>
2173 <span class="nt">&lt;/page&gt;</span>
2174 <span class="nt">&lt;/import&gt;</span>
2175<span class="nt">&lt;/data&gt;</span>
2176</code></pre></div>
0c5338dd
TD
2177<p>You can provide a lot more data for a page, including logical nesting and dedicated handler classes for display in menus.</p>
2178<h2 id="building-the-package">Building the Package<a class="headerlink" href="#building-the-package" title="Permanent link">#</a></h2>
2179<p>If you have followed the above guidelines carefully, your package directory should now look like this:</p>
2180<div class="highlight"><pre><span></span><code>├── files
2181│ └── lib
2182│ ├── page
2183│ │ ├── TestPage.class.php
2184├── package.xml
2185├── page.xml
2186├── templates
2187│ └── test.tpl
2188</code></pre></div>
0c5338dd
TD
2189<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>
2190<p>Last but not least, create the package archive <code>com.example.test.tar</code> and add all the files listed below.</p>
2191<ul>
2192<li><code>files.tar</code></li>
2193<li><code>package.xml</code></li>
2194<li><code>page.xml</code></li>
2195<li><code>templates.tar</code></li>
2196</ul>
2197<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>
2198<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">#</a></h2>
2199<p>Open the Administration Control Panel and navigate to <code>Configuration &gt; Packages &gt; 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>
2200<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>
2201<p>Congratulations, you have just created your first package!</p>
2202<h2 id="developer-tools">Developer Tools<a class="headerlink" href="#developer-tools" title="Permanent link">#</a></h2>
2203<div class="admonition warning">
2204<p class="admonition-title">This feature is available with WoltLab Suite 3.1 or newer only.</p>
2205</div>
2206<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>
2207<h3 id="registering-a-project">Registering a Project<a class="headerlink" href="#registering-a-project" title="Permanent link">#</a></h3>
2208<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>
2209<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>
2210<h3 id="synchronizing">Synchronizing<a class="headerlink" href="#synchronizing" title="Permanent link">#</a></h3>
2211<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>
2212<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>
2213<h2 id="appendix">Appendix<a class="headerlink" href="#appendix" title="Permanent link">#</a></h2>
2214<h3 id="template-guessing">Template Guessing<a class="headerlink" href="#template-guessing" title="Permanent link">#</a></h3>
2215<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>
2216<ol>
2217<li><code>wcf</code>, the internal abbreviation of WoltLab Suite Core (previously known as WoltLab Community Framework)</li>
2218<li><code>\page\</code> (ignored)</li>
2219<li><code>Test</code>, the actual name that is used for both the template and the URL</li>
2220<li><code>Page</code> (page type, ignored)</li>
2221</ol>
2222<p>The fragments <code>1.</code> and <code>3.</code> from above are used to construct the path to the template: <code>&lt;installDirOfWSC&gt;/templates/test.tpl</code> (the first letter of <code>Test</code> is being converted to lower-case).</p>
2223
4a5c32e1
WG
2224
2225
2226
2227<hr>
2228<div class="md-source-date">
2229 <small>
2230
2231 Last update: 2021-01-08
2232
2233 </small>
2234</div>
2235
2236
0c5338dd
TD
2237
2238
2239
2240
2241
2242
2243 </article>
2244 </div>
2245 </div>
fb962f09 2246
0c5338dd
TD
2247 </main>
2248
2249
2250<footer class="md-footer">
2251
2252 <nav class="md-footer__inner md-grid" aria-label="Footer">
2253
2254
2255 <a href="../php/pages/" class="md-footer__link md-footer__link--next" rel="next">
2256 <div class="md-footer__title">
2257 <div class="md-ellipsis">
2258 <span class="md-footer__direction">
2259 Next
2260 </span>
2261 Pages
2262 </div>
2263 </div>
2264 <div class="md-footer__button md-icon">
2265 <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>
2266 </div>
2267 </a>
2268
2269 </nav>
2270
2271 <div class="md-footer-meta md-typeset">
2272 <div class="md-footer-meta__inner md-grid">
2273 <div class="md-footer-copyright">
2274
2275 <div class="md-footer-copyright__highlight">
2276 Copyright © 2020 WoltLab GmbH
2277 </div>
2278
2279 Made with
2280 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
2281 Material for MkDocs
2282 </a>
fb88dc6e 2283
0c5338dd
TD
2284 </div>
2285 <div class="md-footer-copyright">
2286 <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a>
2287 <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a>
2288</div>
2289 </div>
2290 </div>
2291</footer>
2292
2293 </div>
2294 <div class="md-dialog" data-md-component="dialog">
2295 <div class="md-dialog__inner md-typeset"></div>
2296 </div>
fb962f09 2297 <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>
0c5338dd
TD
2298
2299
fb962f09 2300 <script src="../assets/javascripts/bundle.d892486b.min.js"></script>
0c5338dd
TD
2301
2302
2303 </body>
2304</html>