Extension:HalloWorld
![]() Release status: stable |
|
---|---|
Implementation | Parser extension , Tag |
Description | Beginners Introduction to an TAG Hook |
Author(s) | Jan Boer (jackqboxtalk) |
Latest version | 1.0 (2016-10-05) |
MediaWiki | 1.25.5 |
PHP | 5.5.36 |
Database changes | No |
Composer | qbox4u/mediawiki-github |
License | GNU General Public License 2.0 or later |
Download | GitHub: README Release notes |
![]() |
QBox ABC Information template:
This page contains Jack QBox php Extension (lessons) |
The Extension HalloWorld is intended to provide an real first easy learning entry for inexperienced newcomers about how to create an Mediawiki Extension.
Usage[edit]
Perform the following actions
- Create an New Mediawiki page called MY FIRST PHP TAG inside your QBox4u QNAP
- Insert the following Text
<TAG1 arg1="xxx" arg2="xxx"> Hallo world </TAG1> {{#FUNCTION1:Hallo|World}}
- Save the page
Requirements[edit]
You can see that the displayed page is only showing
<TAG1 arg1="xxx" arg2="xxx">
Hallo world
</TAG1>
{{#FUNCTION1:Hallo|World}}
The reason for this, is that we need to install inside the QBox4u QNAP an interface between MediaWiki
and the text inside the page
Installation[edit]
- Open the QBox4u QNAP folder where the main MediaWiki Application resides
- Locate the folder
extensions
- Create inside the folder
extensions
an new folder calledHalloWorld
- Copy HalloWorld.php into the subfolder
extensions/HalloWorld
- Copy LICENSE into the subfolder
extensions/HalloWorld
- Return to the QBox4u QNAP folder where the main MediaWiki Application resides
- Copy the file LocalSettings.php to LocalSettings_org.php
- Add the following line at the bottom inside the file LocalSettings.php
require_once( "$IP/extensions/HalloWorld/HalloWorld.php");
- Save the file LocalSettings.php
Pre Check[edit]
Verify that the Extension:HalloWorld is active
- Select in your mediawiki Special Pages
- Select Version
- allocate Other
When everything is correct, you must see THIS
Result[edit]
Amazing, we have something totally different now in our screen
Using one of the above two methods will give you an quick start with your
own developments to create an dedicated personal PHP application
Allocate therefore inside HalloWorld.php the following lines
/*
From here you can create your own PHP Application
You only need to remember that the additional data you like to display resides inside $html_body
*/