Deployed 541d1ec 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">
743 JavaScript API
744 <span class="md-nav__icon md-icon"></span>
745 </label>
746 <nav class="md-nav" aria-label="JavaScript API" data-md-level="1">
747 <label class="md-nav__title" for="__nav_4">
748 <span class="md-nav__icon md-icon"></span>
749 JavaScript API
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
769
770 <li class="md-nav__item md-nav__item--nested">
771
772
773 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4_2" type="checkbox" id="__nav_4_2" >
774
775 <label class="md-nav__link" for="__nav_4_2">
776 New API
777 <span class="md-nav__icon md-icon"></span>
778 </label>
779 <nav class="md-nav" aria-label="New API" data-md-level="2">
780 <label class="md-nav__title" for="__nav_4_2">
781 <span class="md-nav__icon md-icon"></span>
782 New API
783 </label>
784 <ul class="md-nav__list" data-md-scrollfix>
785
786
787
788
789
790 <li class="md-nav__item">
791 <a href="../javascript/new-api_writing-a-module/" class="md-nav__link">
792 Writing a module
793 </a>
794 </li>
795
796
797
798
799
800
801
802 <li class="md-nav__item">
803 <a href="../javascript/new-api_data-structures/" class="md-nav__link">
804 Data Structures
805 </a>
806 </li>
807
808
809
810
811
812
813
814 <li class="md-nav__item">
815 <a href="../javascript/new-api_core/" class="md-nav__link">
816 Core Functions
817 </a>
818 </li>
819
820
821
822
823
824
825
826 <li class="md-nav__item">
827 <a href="../javascript/new-api_dom/" class="md-nav__link">
828 DOM
829 </a>
830 </li>
831
832
833
834
835
836
837
838 <li class="md-nav__item">
839 <a href="../javascript/new-api_events/" class="md-nav__link">
840 Event Handling
841 </a>
842 </li>
843
844
845
846
847
848
849
850 <li class="md-nav__item">
851 <a href="../javascript/new-api_ajax/" class="md-nav__link">
852 Ajax
853 </a>
854 </li>
855
856
857
858
859
860
861
862 <li class="md-nav__item">
863 <a href="../javascript/new-api_dialogs/" class="md-nav__link">
864 Dialogs
865 </a>
866 </li>
867
868
869
870
871
872
873
874 <li class="md-nav__item">
875 <a href="../javascript/new-api_browser/" class="md-nav__link">
876 Browser and Screen Sizes
877 </a>
878 </li>
879
880
881
882
883
884
885
886 <li class="md-nav__item">
887 <a href="../javascript/new-api_ui/" class="md-nav__link">
888 User Interface
889 </a>
890 </li>
891
892
893
894 </ul>
895 </nav>
896 </li>
897
898
899
900
901
902
903
904 <li class="md-nav__item">
905 <a href="../javascript/legacy-api/" class="md-nav__link">
906 Legacy API
907 </a>
908 </li>
909
910
911
912
913
914
915
916 <li class="md-nav__item">
917 <a href="../javascript/helper-functions/" class="md-nav__link">
918 Helper Functions
919 </a>
920 </li>
921
922
923
924
925
926
927
928 <li class="md-nav__item">
929 <a href="../javascript/code-snippets/" class="md-nav__link">
930 Code Snippets
931 </a>
932 </li>
933
934
935
936 </ul>
937 </nav>
938 </li>
939
940
941
942
943
944
945
946
947
948
949
950 <li class="md-nav__item md-nav__item--nested">
951
952
953 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
954
955 <label class="md-nav__link" for="__nav_5">
956 Package Components
957 <span class="md-nav__icon md-icon"></span>
958 </label>
959 <nav class="md-nav" aria-label="Package Components" data-md-level="1">
960 <label class="md-nav__title" for="__nav_5">
961 <span class="md-nav__icon md-icon"></span>
962 Package Components
963 </label>
964 <ul class="md-nav__list" data-md-scrollfix>
965
966
967
968
969
970 <li class="md-nav__item">
971 <a href="../package/package-xml/" class="md-nav__link">
972 package.xml
973 </a>
974 </li>
975
976
977
978
979
980
981
982
983 <li class="md-nav__item md-nav__item--nested">
984
985
986 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5_2" type="checkbox" id="__nav_5_2" >
987
988 <label class="md-nav__link" for="__nav_5_2">
989 PIPs
990 <span class="md-nav__icon md-icon"></span>
991 </label>
992 <nav class="md-nav" aria-label="PIPs" data-md-level="2">
993 <label class="md-nav__title" for="__nav_5_2">
994 <span class="md-nav__icon md-icon"></span>
995 PIPs
996 </label>
997 <ul class="md-nav__list" data-md-scrollfix>
998
999
1000
1001
1002
1003 <li class="md-nav__item">
1004 <a href="../package/pip/" class="md-nav__link">
1005 Overview
1006 </a>
1007 </li>
1008
1009
1010
1011
1012
1013
1014
1015 <li class="md-nav__item">
1016 <a href="../package/pip/acl-option/" class="md-nav__link">
1017 aclOption
1018 </a>
1019 </li>
1020
1021
1022
1023
1024
1025
1026
1027 <li class="md-nav__item">
1028 <a href="../package/pip/acp-menu/" class="md-nav__link">
1029 acpMenu
1030 </a>
1031 </li>
1032
1033
1034
1035
1036
1037
1038
1039 <li class="md-nav__item">
1040 <a href="../package/pip/acp-search-provider/" class="md-nav__link">
1041 acpSearchProvider
1042 </a>
1043 </li>
1044
1045
1046
1047
1048
1049
1050
1051 <li class="md-nav__item">
1052 <a href="../package/pip/acp-template/" class="md-nav__link">
1053 acpTemplate
1054 </a>
1055 </li>
1056
1057
1058
1059
1060
1061
1062
1063 <li class="md-nav__item">
1064 <a href="../package/pip/bbcode/" class="md-nav__link">
1065 bbcode
1066 </a>
1067 </li>
1068
1069
1070
1071
1072
1073
1074
1075 <li class="md-nav__item">
1076 <a href="../package/pip/box/" class="md-nav__link">
1077 box
1078 </a>
1079 </li>
1080
1081
1082
1083
1084
1085
1086
1087 <li class="md-nav__item">
1088 <a href="../package/pip/clipboard-action/" class="md-nav__link">
1089 clipboardAction
1090 </a>
1091 </li>
1092
1093
1094
1095
1096
1097
1098
1099 <li class="md-nav__item">
1100 <a href="../package/pip/core-object/" class="md-nav__link">
1101 coreObject
1102 </a>
1103 </li>
1104
1105
1106
1107
1108
1109
1110
1111 <li class="md-nav__item">
1112 <a href="../package/pip/cronjob/" class="md-nav__link">
1113 cronjob
1114 </a>
1115 </li>
1116
1117
1118
1119
1120
1121
1122
1123 <li class="md-nav__item">
1124 <a href="../package/pip/event-listener/" class="md-nav__link">
1125 eventListener
1126 </a>
1127 </li>
1128
1129
1130
1131
1132
1133
1134
1135 <li class="md-nav__item">
1136 <a href="../package/pip/file/" class="md-nav__link">
1137 file
1138 </a>
1139 </li>
1140
1141
1142
1143
1144
1145
1146
1147 <li class="md-nav__item">
1148 <a href="../package/pip/language/" class="md-nav__link">
1149 language
1150 </a>
1151 </li>
1152
1153
1154
1155
1156
1157
1158
1159 <li class="md-nav__item">
1160 <a href="../package/pip/media-provider/" class="md-nav__link">
1161 mediaProvider
1162 </a>
1163 </li>
1164
1165
1166
1167
1168
1169
1170
1171 <li class="md-nav__item">
1172 <a href="../package/pip/menu/" class="md-nav__link">
1173 menu
1174 </a>
1175 </li>
1176
1177
1178
1179
1180
1181
1182
1183 <li class="md-nav__item">
1184 <a href="../package/pip/menu-item/" class="md-nav__link">
1185 menuItem
1186 </a>
1187 </li>
1188
1189
1190
1191
1192
1193
1194
1195 <li class="md-nav__item">
1196 <a href="../package/pip/object-type/" class="md-nav__link">
1197 objectType
1198 </a>
1199 </li>
1200
1201
1202
1203
1204
1205
1206
1207 <li class="md-nav__item">
1208 <a href="../package/pip/object-type-definition/" class="md-nav__link">
1209 objectTypeDefinition
1210 </a>
1211 </li>
1212
1213
1214
1215
1216
1217
1218
1219 <li class="md-nav__item">
1220 <a href="../package/pip/option/" class="md-nav__link">
1221 option
1222 </a>
1223 </li>
1224
1225
1226
1227
1228
1229
1230
1231 <li class="md-nav__item">
1232 <a href="../package/pip/page/" class="md-nav__link">
1233 page
1234 </a>
1235 </li>
1236
1237
1238
1239
1240
1241
1242
1243 <li class="md-nav__item">
1244 <a href="../package/pip/pip/" class="md-nav__link">
1245 pip
1246 </a>
1247 </li>
1248
1249
1250
1251
1252
1253
1254
1255 <li class="md-nav__item">
1256 <a href="../package/pip/script/" class="md-nav__link">
1257 script
1258 </a>
1259 </li>
1260
1261
1262
1263
1264
1265
1266
1267 <li class="md-nav__item">
1268 <a href="../package/pip/smiley/" class="md-nav__link">
1269 smiley
1270 </a>
1271 </li>
1272
1273
1274
1275
1276
1277
1278
1279 <li class="md-nav__item">
1280 <a href="../package/pip/sql/" class="md-nav__link">
1281 sql
1282 </a>
1283 </li>
1284
1285
1286
1287
1288
1289
1290
1291 <li class="md-nav__item">
1292 <a href="../package/pip/style/" class="md-nav__link">
1293 style
1294 </a>
1295 </li>
1296
1297
1298
1299
1300
1301
1302
1303 <li class="md-nav__item">
1304 <a href="../package/pip/template/" class="md-nav__link">
1305 template
1306 </a>
1307 </li>
1308
1309
1310
1311
1312
1313
1314
1315 <li class="md-nav__item">
1316 <a href="../package/pip/template-listener/" class="md-nav__link">
1317 templateListener
1318 </a>
1319 </li>
1320
1321
1322
1323
1324
1325
1326
1327 <li class="md-nav__item">
1328 <a href="../package/pip/user-group-option/" class="md-nav__link">
1329 userGroupOption
1330 </a>
1331 </li>
1332
1333
1334
1335
1336
1337
1338
1339 <li class="md-nav__item">
1340 <a href="../package/pip/user-menu/" class="md-nav__link">
1341 userMenu
1342 </a>
1343 </li>
1344
1345
1346
1347
1348
1349
1350
1351 <li class="md-nav__item">
1352 <a href="../package/pip/user-notification-event/" class="md-nav__link">
1353 userNotificationEvent
1354 </a>
1355 </li>
1356
1357
1358
1359
1360
1361
1362
1363 <li class="md-nav__item">
1364 <a href="../package/pip/user-option/" class="md-nav__link">
1365 userOption
1366 </a>
1367 </li>
1368
1369
1370
1371
1372
1373
1374
1375 <li class="md-nav__item">
1376 <a href="../package/pip/user-profile-menu/" class="md-nav__link">
1377 userProfileMenu
1378 </a>
1379 </li>
1380
1381
1382
1383 </ul>
1384 </nav>
1385 </li>
1386
1387
1388
1389
1390
1391
1392
1393 <li class="md-nav__item">
1394 <a href="../package/database-php-api/" class="md-nav__link">
1395 Database PHP API
1396 </a>
1397 </li>
1398
1399
1400
1401 </ul>
1402 </nav>
1403 </li>
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415 <li class="md-nav__item md-nav__item--nested">
1416
1417
1418 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
1419
1420 <label class="md-nav__link" for="__nav_6">
1421 Migration
1422 <span class="md-nav__icon md-icon"></span>
1423 </label>
1424 <nav class="md-nav" aria-label="Migration" data-md-level="1">
1425 <label class="md-nav__title" for="__nav_6">
1426 <span class="md-nav__icon md-icon"></span>
1427 Migration
1428 </label>
1429 <ul class="md-nav__list" data-md-scrollfix>
1430
1431
1432
1433
1434
1435
1436 <li class="md-nav__item md-nav__item--nested">
1437
1438
1439 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_1" type="checkbox" id="__nav_6_1" >
1440
1441 <label class="md-nav__link" for="__nav_6_1">
1442 Migrating from WSC 5.3
1443 <span class="md-nav__icon md-icon"></span>
1444 </label>
1445 <nav class="md-nav" aria-label="Migrating from WSC 5.3" data-md-level="2">
1446 <label class="md-nav__title" for="__nav_6_1">
1447 <span class="md-nav__icon md-icon"></span>
1448 Migrating from WSC 5.3
1449 </label>
1450 <ul class="md-nav__list" data-md-scrollfix>
1451
1452
1453
1454
1455
1456 <li class="md-nav__item">
1457 <a href="../migration/wsc53/php/" class="md-nav__link">
1458 PHP API
1459 </a>
1460 </li>
1461
1462
1463
1464
1465
1466
1467
1468 <li class="md-nav__item">
1469 <a href="../migration/wsc53/session/" class="md-nav__link">
1470 Session Handling and Authentication
1471 </a>
1472 </li>
1473
1474
1475
1476
1477
1478
1479
1480 <li class="md-nav__item">
1481 <a href="../migration/wsc53/javascript/" class="md-nav__link">
1482 JavaScript
1483 </a>
1484 </li>
1485
1486
1487
1488
1489
1490
1491
1492 <li class="md-nav__item">
1493 <a href="../migration/wsc53/templates/" class="md-nav__link">
1494 Templates
1495 </a>
1496 </li>
1497
1498
1499
1500
1501
1502
1503
1504 <li class="md-nav__item">
1505 <a href="../migration/wsc53/libraries/" class="md-nav__link">
1506 Third Party Libraries
1507 </a>
1508 </li>
1509
1510
1511
1512 </ul>
1513 </nav>
1514 </li>
1515
1516
1517
1518
1519
1520
1521
1522
1523 <li class="md-nav__item md-nav__item--nested">
1524
1525
1526 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_2" type="checkbox" id="__nav_6_2" >
1527
1528 <label class="md-nav__link" for="__nav_6_2">
1529 Migrating from WSC 5.2
1530 <span class="md-nav__icon md-icon"></span>
1531 </label>
1532 <nav class="md-nav" aria-label="Migrating from WSC 5.2" data-md-level="2">
1533 <label class="md-nav__title" for="__nav_6_2">
1534 <span class="md-nav__icon md-icon"></span>
1535 Migrating from WSC 5.2
1536 </label>
1537 <ul class="md-nav__list" data-md-scrollfix>
1538
1539
1540
1541
1542
1543 <li class="md-nav__item">
1544 <a href="../migration/wsc52/php/" class="md-nav__link">
1545 PHP API
1546 </a>
1547 </li>
1548
1549
1550
1551
1552
1553
1554
1555 <li class="md-nav__item">
1556 <a href="../migration/wsc52/templates/" class="md-nav__link">
1557 Templates and Languages
1558 </a>
1559 </li>
1560
1561
1562
1563
1564
1565
1566
1567 <li class="md-nav__item">
1568 <a href="../migration/wsc52/libraries/" class="md-nav__link">
1569 Third Party Libraries
1570 </a>
1571 </li>
1572
1573
1574
1575 </ul>
1576 </nav>
1577 </li>
1578
1579
1580
1581
1582
1583
1584
1585
1586 <li class="md-nav__item md-nav__item--nested">
1587
1588
1589 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_3" type="checkbox" id="__nav_6_3" >
1590
1591 <label class="md-nav__link" for="__nav_6_3">
1592 Migrating from WSC 3.1
1593 <span class="md-nav__icon md-icon"></span>
1594 </label>
1595 <nav class="md-nav" aria-label="Migrating from WSC 3.1" data-md-level="2">
1596 <label class="md-nav__title" for="__nav_6_3">
1597 <span class="md-nav__icon md-icon"></span>
1598 Migrating from WSC 3.1
1599 </label>
1600 <ul class="md-nav__list" data-md-scrollfix>
1601
1602
1603
1604
1605
1606 <li class="md-nav__item">
1607 <a href="../migration/wsc31/php/" class="md-nav__link">
1608 PHP API
1609 </a>
1610 </li>
1611
1612
1613
1614 </ul>
1615 </nav>
1616 </li>
1617
1618
1619
1620
1621
1622
1623
1624
1625 <li class="md-nav__item md-nav__item--nested">
1626
1627
1628 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_4" type="checkbox" id="__nav_6_4" >
1629
1630 <label class="md-nav__link" for="__nav_6_4">
1631 Migrating from WSC 3.0
1632 <span class="md-nav__icon md-icon"></span>
1633 </label>
1634 <nav class="md-nav" aria-label="Migrating from WSC 3.0" data-md-level="2">
1635 <label class="md-nav__title" for="__nav_6_4">
1636 <span class="md-nav__icon md-icon"></span>
1637 Migrating from WSC 3.0
1638 </label>
1639 <ul class="md-nav__list" data-md-scrollfix>
1640
1641
1642
1643
1644
1645 <li class="md-nav__item">
1646 <a href="../migration/wsc30/php/" class="md-nav__link">
1647 PHP API
1648 </a>
1649 </li>
1650
1651
1652
1653
1654
1655
1656
1657 <li class="md-nav__item">
1658 <a href="../migration/wsc30/javascript/" class="md-nav__link">
1659 JavaScript API
1660 </a>
1661 </li>
1662
1663
1664
1665
1666
1667
1668
1669 <li class="md-nav__item">
1670 <a href="../migration/wsc30/templates/" class="md-nav__link">
1671 Templates
1672 </a>
1673 </li>
1674
1675
1676
1677
1678
1679
1680
1681 <li class="md-nav__item">
1682 <a href="../migration/wsc30/css/" class="md-nav__link">
1683 CSS
1684 </a>
1685 </li>
1686
1687
1688
1689
1690
1691
1692
1693 <li class="md-nav__item">
1694 <a href="../migration/wsc30/package/" class="md-nav__link">
1695 Package Components
1696 </a>
1697 </li>
1698
1699
1700
1701 </ul>
1702 </nav>
1703 </li>
1704
1705
1706
1707
1708
1709
1710
1711
1712 <li class="md-nav__item md-nav__item--nested">
1713
1714
1715 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6_5" type="checkbox" id="__nav_6_5" >
1716
1717 <label class="md-nav__link" for="__nav_6_5">
1718 Migrating from WCF 2.1
1719 <span class="md-nav__icon md-icon"></span>
1720 </label>
1721 <nav class="md-nav" aria-label="Migrating from WCF 2.1" data-md-level="2">
1722 <label class="md-nav__title" for="__nav_6_5">
1723 <span class="md-nav__icon md-icon"></span>
1724 Migrating from WCF 2.1
1725 </label>
1726 <ul class="md-nav__list" data-md-scrollfix>
1727
1728
1729
1730
1731
1732 <li class="md-nav__item">
1733 <a href="../migration/wcf21/php/" class="md-nav__link">
1734 PHP API
1735 </a>
1736 </li>
1737
1738
1739
1740
1741
1742
1743
1744 <li class="md-nav__item">
1745 <a href="../migration/wcf21/templates/" class="md-nav__link">
1746 Templates
1747 </a>
1748 </li>
1749
1750
1751
1752
1753
1754
1755
1756 <li class="md-nav__item">
1757 <a href="../migration/wcf21/css/" class="md-nav__link">
1758 CSS
1759 </a>
1760 </li>
1761
1762
1763
1764
1765
1766
1767
1768 <li class="md-nav__item">
1769 <a href="../migration/wcf21/package/" class="md-nav__link">
1770 Package Components
1771 </a>
1772 </li>
1773
1774
1775
1776 </ul>
1777 </nav>
1778 </li>
1779
1780
1781
1782 </ul>
1783 </nav>
1784 </li>
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796 <li class="md-nav__item md-nav__item--nested">
1797
1798
1799 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
1800
1801 <label class="md-nav__link" for="__nav_7">
1802 Tutorials
1803 <span class="md-nav__icon md-icon"></span>
1804 </label>
1805 <nav class="md-nav" aria-label="Tutorials" data-md-level="1">
1806 <label class="md-nav__title" for="__nav_7">
1807 <span class="md-nav__icon md-icon"></span>
1808 Tutorials
1809 </label>
1810 <ul class="md-nav__list" data-md-scrollfix>
1811
1812
1813
1814
1815
1816
1817 <li class="md-nav__item md-nav__item--nested">
1818
1819
1820 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7_1" type="checkbox" id="__nav_7_1" >
1821
1822 <label class="md-nav__link" for="__nav_7_1">
1823 Tutorial Series
1824 <span class="md-nav__icon md-icon"></span>
1825 </label>
1826 <nav class="md-nav" aria-label="Tutorial Series" data-md-level="2">
1827 <label class="md-nav__title" for="__nav_7_1">
1828 <span class="md-nav__icon md-icon"></span>
1829 Tutorial Series
1830 </label>
1831 <ul class="md-nav__list" data-md-scrollfix>
1832
1833
1834
1835
1836
1837 <li class="md-nav__item">
1838 <a href="../tutorial/series/overview/" class="md-nav__link">
1839 Overview
1840 </a>
1841 </li>
1842
1843
1844
1845
1846
1847
1848
1849 <li class="md-nav__item">
1850 <a href="../tutorial/series/part_1/" class="md-nav__link">
1851 Part 1
1852 </a>
1853 </li>
1854
1855
1856
1857
1858
1859
1860
1861 <li class="md-nav__item">
1862 <a href="../tutorial/series/part_2/" class="md-nav__link">
1863 Part 2
1864 </a>
1865 </li>
1866
1867
1868
1869
1870
1871
1872
1873 <li class="md-nav__item">
1874 <a href="../tutorial/series/part_3/" class="md-nav__link">
1875 Part 3
1876 </a>
1877 </li>
1878
1879
1880
1881 </ul>
1882 </nav>
1883 </li>
1884
1885
1886
1887 </ul>
1888 </nav>
1889 </li>
1890
1891
1892
1893 </ul>
1894</nav>
1895 </div>
1896 </div>
1897 </div>
1898
1899
1900
1901 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
1902 <div class="md-sidebar__scrollwrap">
1903 <div class="md-sidebar__inner">
1904
1905<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
1906
1907
1908
1909
1910
1911 <label class="md-nav__title" for="__toc">
1912 <span class="md-nav__icon md-icon"></span>
1913 Table of contents
1914 </label>
1915 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
1916
1917 <li class="md-nav__item">
1918 <a href="#setup-and-requirements" class="md-nav__link">
1919 Setup and Requirements
1920 </a>
1921
1922</li>
1923
1924 <li class="md-nav__item">
1925 <a href="#the-packagexml-file" class="md-nav__link">
1926 The package.xml File
1927 </a>
1928
1929</li>
1930
1931 <li class="md-nav__item">
1932 <a href="#the-php-class" class="md-nav__link">
1933 The PHP Class
1934 </a>
1935
1936</li>
1937
1938 <li class="md-nav__item">
1939 <a href="#the-template" class="md-nav__link">
1940 The Template
1941 </a>
1942
1943</li>
1944
1945 <li class="md-nav__item">
1946 <a href="#the-page-definition" class="md-nav__link">
1947 The Page Definition
1948 </a>
1949
1950</li>
1951
1952 <li class="md-nav__item">
1953 <a href="#building-the-package" class="md-nav__link">
1954 Building the Package
1955 </a>
1956
1957</li>
1958
1959 <li class="md-nav__item">
1960 <a href="#installation" class="md-nav__link">
1961 Installation
1962 </a>
1963
1964</li>
1965
1966 <li class="md-nav__item">
1967 <a href="#developer-tools" class="md-nav__link">
1968 Developer Tools
1969 </a>
1970
1971 <nav class="md-nav" aria-label="Developer Tools">
1972 <ul class="md-nav__list">
1973
1974 <li class="md-nav__item">
1975 <a href="#registering-a-project" class="md-nav__link">
1976 Registering a Project
1977 </a>
1978
1979</li>
1980
1981 <li class="md-nav__item">
1982 <a href="#synchronizing" class="md-nav__link">
1983 Synchronizing
1984 </a>
1985
1986</li>
1987
1988 </ul>
1989 </nav>
1990
1991</li>
1992
1993 <li class="md-nav__item">
1994 <a href="#appendix" class="md-nav__link">
1995 Appendix
1996 </a>
1997
1998 <nav class="md-nav" aria-label="Appendix">
1999 <ul class="md-nav__list">
2000
2001 <li class="md-nav__item">
2002 <a href="#template-guessing" class="md-nav__link">
2003 Template Guessing
2004 </a>
2005
2006</li>
2007
2008 </ul>
2009 </nav>
2010
2011</li>
2012
2013 </ul>
2014
2015</nav>
2016 </div>
2017 </div>
2018 </div>
2019
2020
2021 <div class="md-content" data-md-component="content">
2022 <article class="md-content__inner md-typeset">
2023
2024
9b8bddda 2025 <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
2026 <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>
2027 </a>
2028
0c5338dd
TD
2029
2030 <h1 id="creating-a-simple-package">Creating a simple package<a class="headerlink" href="#creating-a-simple-package" title="Permanent link">#</a></h1>
2031<h2 id="setup-and-requirements">Setup and Requirements<a class="headerlink" href="#setup-and-requirements" title="Permanent link">#</a></h2>
2032<p>This guide will help you to create a simple package that provides a simple test
2033page. It is nothing too fancy, but you can use it as the foundation for your
2034next project.</p>
2035<p>There are some requirements you should met before starting:</p>
2036<ul>
2037<li>Text editor with syntax highlighting for PHP, <a href="https://notepad-plus-plus.org/">Notepad++</a> is a solid pick</li>
2038<li><code>*.php</code> and <code>*.tpl</code> should be encoded with ANSI/ASCII</li>
2039<li><code>*.xml</code> are always encoded with UTF-8, but omit the BOM (byte-order-mark)</li>
2040<li>Use tabs instead of spaces to indent lines</li>
2041<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>
2042<li>An active installation of WoltLab Suite 3</li>
2043<li>An application to create <code>*.tar</code> archives, e.g. <a href="http://www.7-zip.org/">7-Zip</a> on Windows</li>
2044</ul>
2045<h2 id="the-packagexml-file">The package.xml File<a class="headerlink" href="#the-packagexml-file" title="Permanent link">#</a></h2>
2046<p>We want to create a simple page that will display the sentence "Hello World" embedded
2047into the application frame. Create an empty directory in the workspace of your choice
2048to start with.</p>
2049<p>Create a new file called <code>package.xml</code> and insert the code below:</p>
2050<div class="highlight"><pre><span></span><code><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
2051<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>
2052 <span class="nt">&lt;packageinformation&gt;</span>
2053 <span class="c">&lt;!-- com.example.test --&gt;</span>
2054 <span class="nt">&lt;packagename&gt;</span>Simple Package<span class="nt">&lt;/packagename&gt;</span>
2055 <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>
2056 <span class="nt">&lt;version&gt;</span>1.0.0<span class="nt">&lt;/version&gt;</span>
2057 <span class="nt">&lt;date&gt;</span>2019-04-28<span class="nt">&lt;/date&gt;</span>
2058 <span class="nt">&lt;/packageinformation&gt;</span>
2059 <span class="nt">&lt;authorinformation&gt;</span>
2060 <span class="nt">&lt;author&gt;</span>Your Name<span class="nt">&lt;/author&gt;</span>
2061 <span class="nt">&lt;authorurl&gt;</span>http://www.example.com<span class="nt">&lt;/authorurl&gt;</span>
2062 <span class="nt">&lt;/authorinformation&gt;</span>
2063 <span class="nt">&lt;excludedpackages&gt;</span>
2064 <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>
2065 <span class="nt">&lt;/excludedpackages&gt;</span>
2066 <span class="nt">&lt;instructions</span> <span class="na">type=</span><span class="s">&quot;install&quot;</span><span class="nt">&gt;</span>
2067 <span class="nt">&lt;instruction</span> <span class="na">type=</span><span class="s">&quot;file&quot;</span> <span class="nt">/&gt;</span>
2068 <span class="nt">&lt;instruction</span> <span class="na">type=</span><span class="s">&quot;template&quot;</span> <span class="nt">/&gt;</span>
2069 <span class="nt">&lt;instruction</span> <span class="na">type=</span><span class="s">&quot;page&quot;</span> <span class="nt">/&gt;</span>
2070 <span class="nt">&lt;/instructions&gt;</span>
2071<span class="nt">&lt;/package&gt;</span>
2072</code></pre></div>
0c5338dd
TD
2073<p>There is an <a href="../package/package-xml/">entire chapter</a> on the package system that explains what the code above
2074does and how you can adjust it to fit your needs. For now we'll keep it as it is.</p>
2075<h2 id="the-php-class">The PHP Class<a class="headerlink" href="#the-php-class" title="Permanent link">#</a></h2>
2076<p>The next step is to create the PHP class which will serve our page:</p>
2077<ol>
2078<li>Create the directory <code>files</code> in the same directory where <code>package.xml</code> is located</li>
2079<li>Open <code>files</code> and create the directory <code>lib</code></li>
2080<li>Open <code>lib</code> and create the directory <code>page</code></li>
2081<li>Within the directory <code>page</code>, please create the file <code>TestPage.class.php</code></li>
2082</ol>
2083<p>Copy and paste the following code into the <code>TestPage.class.php</code>:</p>
2084<div class="highlight"><pre><span></span><code><span class="o">&lt;?</span><span class="nx">php</span>
2085<span class="k">namespace</span> <span class="nx">wcf\page</span><span class="p">;</span>
2086<span class="k">use</span> <span class="nx">wcf\system\WCF</span><span class="p">;</span>
2087
2088<span class="sd">/**</span>
2089<span class="sd"> * A simple test page for demonstration purposes.</span>
2090<span class="sd"> *</span>
2091<span class="sd"> * @author YOUR NAME</span>
2092<span class="sd"> * @license GNU Lesser General Public License &lt;http://opensource.org/licenses/lgpl-license.php&gt;</span>
2093<span class="sd"> */</span>
2094<span class="k">class</span> <span class="nc">TestPage</span> <span class="k">extends</span> <span class="nx">AbstractPage</span> <span class="p">{</span>
2095 <span class="sd">/**</span>
2096<span class="sd"> * @var string</span>
2097<span class="sd"> */</span>
2098 <span class="k">protected</span> <span class="nv">$greet</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span>
2099
2100 <span class="sd">/**</span>
2101<span class="sd"> * @inheritDoc</span>
2102<span class="sd"> */</span>
2103 <span class="k">public</span> <span class="k">function</span> <span class="nf">readParameters</span><span class="p">()</span> <span class="p">{</span>
2104 <span class="k">parent</span><span class="o">::</span><span class="na">readParameters</span><span class="p">();</span>
2105
2106 <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>
2107 <span class="p">}</span>
2108
2109 <span class="sd">/**</span>
2110<span class="sd"> * @inheritDoc</span>
2111<span class="sd"> */</span>
2112 <span class="k">public</span> <span class="k">function</span> <span class="nf">readData</span><span class="p">()</span> <span class="p">{</span>
2113 <span class="k">parent</span><span class="o">::</span><span class="na">readData</span><span class="p">();</span>
2114
2115 <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>
2116 <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>
2117 <span class="p">}</span>
2118 <span class="p">}</span>
2119
2120 <span class="sd">/**</span>
2121<span class="sd"> * @inheritDoc</span>
2122<span class="sd"> */</span>
2123 <span class="k">public</span> <span class="k">function</span> <span class="nf">assignVariables</span><span class="p">()</span> <span class="p">{</span>
2124 <span class="k">parent</span><span class="o">::</span><span class="na">assignVariables</span><span class="p">();</span>
2125
2126 <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>
2127 <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>
2128 <span class="p">]);</span>
2129 <span class="p">}</span>
2130<span class="p">}</span>
2131</code></pre></div>
0c5338dd
TD
2132<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
2133defines 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>
2134<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
2135processing 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
2136start 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>
2137<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
2138namespace and class name, you can <a href="#template-guessing">read more about it later</a>.</p>
2139<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>
2140<h2 id="the-template">The Template<a class="headerlink" href="#the-template" title="Permanent link">#</a></h2>
2141<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>
2142<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>
2143
2144<span class="x">&lt;div class=&quot;section&quot;&gt;</span>
2145<span class="x"> Hello </span><span class="cp">{</span><span class="nv">$greet</span><span class="cp">}</span><span class="x">!</span>
2146<span class="x">&lt;/div&gt;</span>
2147
2148<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>
2149</code></pre></div>
0c5338dd
TD
2150<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
2151page 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>
2152<h2 id="the-page-definition">The Page Definition<a class="headerlink" href="#the-page-definition" title="Permanent link">#</a></h2>
2153<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>
2154<div class="highlight"><pre><span></span><code><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
2155<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>
2156 <span class="nt">&lt;import&gt;</span>
2157 <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>
2158 <span class="nt">&lt;controller&gt;</span>wcf\page\TestPage<span class="nt">&lt;/controller&gt;</span>
2159 <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>
2160 <span class="nt">&lt;pageType&gt;</span>system<span class="nt">&lt;/pageType&gt;</span>
2161 <span class="nt">&lt;/page&gt;</span>
2162 <span class="nt">&lt;/import&gt;</span>
2163<span class="nt">&lt;/data&gt;</span>
2164</code></pre></div>
0c5338dd
TD
2165<p>You can provide a lot more data for a page, including logical nesting and dedicated handler classes for display in menus.</p>
2166<h2 id="building-the-package">Building the Package<a class="headerlink" href="#building-the-package" title="Permanent link">#</a></h2>
2167<p>If you have followed the above guidelines carefully, your package directory should now look like this:</p>
2168<div class="highlight"><pre><span></span><code>├── files
2169│ └── lib
2170│ ├── page
2171│ │ ├── TestPage.class.php
2172├── package.xml
2173├── page.xml
2174├── templates
2175│ └── test.tpl
2176</code></pre></div>
0c5338dd
TD
2177<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>
2178<p>Last but not least, create the package archive <code>com.example.test.tar</code> and add all the files listed below.</p>
2179<ul>
2180<li><code>files.tar</code></li>
2181<li><code>package.xml</code></li>
2182<li><code>page.xml</code></li>
2183<li><code>templates.tar</code></li>
2184</ul>
2185<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>
2186<h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">#</a></h2>
2187<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>
2188<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>
2189<p>Congratulations, you have just created your first package!</p>
2190<h2 id="developer-tools">Developer Tools<a class="headerlink" href="#developer-tools" title="Permanent link">#</a></h2>
2191<div class="admonition warning">
2192<p class="admonition-title">This feature is available with WoltLab Suite 3.1 or newer only.</p>
2193</div>
2194<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>
2195<h3 id="registering-a-project">Registering a Project<a class="headerlink" href="#registering-a-project" title="Permanent link">#</a></h3>
2196<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>
2197<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>
2198<h3 id="synchronizing">Synchronizing<a class="headerlink" href="#synchronizing" title="Permanent link">#</a></h3>
2199<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>
2200<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>
2201<h2 id="appendix">Appendix<a class="headerlink" href="#appendix" title="Permanent link">#</a></h2>
2202<h3 id="template-guessing">Template Guessing<a class="headerlink" href="#template-guessing" title="Permanent link">#</a></h3>
2203<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>
2204<ol>
2205<li><code>wcf</code>, the internal abbreviation of WoltLab Suite Core (previously known as WoltLab Community Framework)</li>
2206<li><code>\page\</code> (ignored)</li>
2207<li><code>Test</code>, the actual name that is used for both the template and the URL</li>
2208<li><code>Page</code> (page type, ignored)</li>
2209</ol>
2210<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>
2211
4a5c32e1
WG
2212
2213
2214
2215<hr>
2216<div class="md-source-date">
2217 <small>
2218
2219 Last update: 2021-01-08
2220
2221 </small>
2222</div>
2223
2224
0c5338dd
TD
2225
2226
2227
2228
2229
2230
2231 </article>
2232 </div>
2233 </div>
fb962f09 2234
0c5338dd
TD
2235 </main>
2236
2237
2238<footer class="md-footer">
2239
2240 <nav class="md-footer__inner md-grid" aria-label="Footer">
2241
2242
2243 <a href="../php/pages/" class="md-footer__link md-footer__link--next" rel="next">
2244 <div class="md-footer__title">
2245 <div class="md-ellipsis">
2246 <span class="md-footer__direction">
2247 Next
2248 </span>
2249 Pages
2250 </div>
2251 </div>
2252 <div class="md-footer__button md-icon">
2253 <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>
2254 </div>
2255 </a>
2256
2257 </nav>
2258
2259 <div class="md-footer-meta md-typeset">
2260 <div class="md-footer-meta__inner md-grid">
2261 <div class="md-footer-copyright">
2262
2263 <div class="md-footer-copyright__highlight">
2264 Copyright © 2020 WoltLab GmbH
2265 </div>
2266
2267 Made with
2268 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
2269 Material for MkDocs
2270 </a>
fb88dc6e 2271
0c5338dd
TD
2272 </div>
2273 <div class="md-footer-copyright">
2274 <a href="https://www.woltlab.com/legal-notice/">Legal Notice</a>
2275 <a href="https://www.woltlab.com/privacy-policy/">Privacy Policy</a>
2276</div>
2277 </div>
2278 </div>
2279</footer>
2280
2281 </div>
2282 <div class="md-dialog" data-md-component="dialog">
2283 <div class="md-dialog__inner md-typeset"></div>
2284 </div>
fb962f09 2285 <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
2286
2287
fb962f09 2288 <script src="../assets/javascripts/bundle.d892486b.min.js"></script>
0c5338dd
TD
2289
2290
2291 </body>
2292</html>