"Hello World!" - Extension & Skeleton Tool

Discussion forum for Extension Writers regarding Extension Development.
User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

"Hello World!" - Extension & Skeleton Tool

Post by nickvergessen »

*************************** UPDATE ***************************
This extension has been released as a phpBB Official Tool.
It can now be downloaded from our Extensions Database.
*************************** UPDATE ***************************


I made an as-simple-as-possible Extension that uses some of the basic mechanisms in phpBB 3.1 your extension will use aswell:
  • Events: for adding a link to a new page in the header and loading a language file globally
  • Routes and Controllers: which display the new page
  • Ext Language files: so your files are where your code is
  • Ext Style files: so your style files are where your code is
  • Migrations: Database changes similar to UMIL in 3.0
  • ACP Module
You can find the code at https://github.com/phpbb/phpbb-ext-acme-demo
To install it and see the demo:
  1. Download the .zip
  2. Create the folder ext/acme/demo/ next to your config.php
  3. Copy the content from the .zip to the new folder
  4. Go to ACP > Customise > Extensions >
    and enable the Acme Demo Extension extension
Now you should see the link in the header:
acme-demo-link.png
acme-demo-link.png (11.48 KiB) Viewed 15284 times
and if you click it, you should see the "Hello World!"
acme-demo-page.png
If you change the url from phpBB/app.php/demo/world to phpBB/app.php/demo/nickvergessen,
you will see the message "Hello nickvergessen!"

---------------------------------------------------------------------
(Updated Mar 13, 2016 by VSE)

The Extension Skeleton is an extension that you install in your development phpBB board. Once installed, you can use it to generate the starter files and directories for your own extensions.

The Extension Skeleton will ask you for some basic information about the extension you want to create, such as the name, author information, requirements, and what type of components it will use (listeners, controllers, styles, template events, unit testing, etc.). It will then generate an extension package based on your needs. It will be a working “skeleton” of the Acme Demo extension, and will be ready for you to begin to edit and update with your own code.
2015-06-27_12_48_29.png
It can be accessed via Graphic User Interface through a link in your forum’s navbar and from the Command Line Interface with the command: $ bin/phpbbcli.php extension:create

The Extension Skeleton is a great litle tool that every extension developer should have in their toolkit. It simplifies and expedites the mundane task of starting a new extension, and ensures you have a correctly configured set of composer, PHP and style files with which to begin coding your extension.
No Support via PM
User avatar
Galandas
Registered User
Posts: 734
Joined: Thu Jul 23, 2009 4:11 pm
Location: Italy
Name: Rey
Contact:

Re: "Hello World!" - Extension

Post by Galandas »

Thank you!
English is not my native language My CDB Contributions My RC extensions
User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: "Hello World!" - Extension

Post by nickvergessen »

Added a migration and ACP module.
No Support via PM
nachtelb
Registered User
Posts: 158
Joined: Sun Feb 19, 2006 2:00 pm
Location: Germany
Name: Bernhard
Contact:

Re: "Hello World!" - Extension

Post by nachtelb »

Thank you! I will have a look on it and try to understand. :)
User avatar
Mess
Registered User
Posts: 985
Joined: Wed Jul 01, 2009 6:37 am
Name: Kim

Re: "Hello World!" - Extension

Post by Mess »

Thanks! :)
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: "Hello World!" - Extension

Post by ViolaF »

Thanks again for your work. Please add a little acp example as mentioned
viewtopic.php?f=461&t=2211141#p13460301
User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: "Hello World!" - Extension

Post by nickvergessen »

ACP Example is already included (just no screenshot)
No Support via PM
User avatar
ViolaF
I've Been Banned!
Posts: 1609
Joined: Tue Aug 14, 2012 11:52 pm

Re: "Hello World!" - Extension

Post by ViolaF »

Thanks again very much for your effort :D
wintstar
Registered User
Posts: 330
Joined: Sat Mar 07, 2009 12:39 pm
Location: Central Hessen, close to the "heart of nature", Germany
Contact:

Re: "Hello World!" - Extension

Post by wintstar »

With Build #1296 there is this error message:

Code: Select all

Fatal error: Call to undefined method phpbb\controller\helper::url() in ...\ext\acme\demo\event\main_listener.php on line 61
Is this a bug?
User avatar
Pico88
Registered User
Posts: 878
Joined: Sat Mar 07, 2009 10:24 pm
Location: Poland
Name: Lukasz

Re: "Hello World!" - Extension

Post by Pico88 »

url method is changed to route in the latest release, so that is why you get that error ;)
Please do not PM me for support.
wintstar
Registered User
Posts: 330
Joined: Sat Mar 07, 2009 12:39 pm
Location: Central Hessen, close to the "heart of nature", Germany
Contact:

Re: "Hello World!" - Extension

Post by wintstar »

Many thanks picco88 :)
User avatar
nickvergessen
Former Team Member
Posts: 4397
Joined: Mon Apr 30, 2007 5:33 pm
Location: Stuttgart, Germany
Name: Joas Schilling
Contact:

Re: "Hello World!" - Extension

Post by nickvergessen »

Is updated now and should be running again
No Support via PM
wintstar
Registered User
Posts: 330
Joined: Sat Mar 07, 2009 12:39 pm
Location: Central Hessen, close to the "heart of nature", Germany
Contact:

Re: "Hello World!" - Extension

Post by wintstar »

Thanks nickvergessen :)
User avatar
Stoker 4.0
Registered User
Posts: 1487
Joined: Sun Feb 13, 2011 1:33 pm
Location: Funen, Denmark
Name: Ulrik Christensen
Contact:

Re: "Hello World!" - Extension

Post by Stoker 4.0 »

Required meta field 'licence' has not been set.
User avatar
PayBas
Former Team Member
Posts: 930
Joined: Thu May 25, 2006 12:37 am

Re: "Hello World!" - Extension

Post by PayBas »

Stoker 4.0 wrote:Required meta field 'licence' has not been set.
Too early. Either use licence (instead of license), or wait for beta 2.

viewtopic.php?f=461&t=2234931
Post Reply

Return to “Extension Writers Discussion”