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