Development Wiki

Developing Extensions

From phpBB Development Wiki

Revision as of 15:52, 9 January 2013 by Marc (Talk | contribs)

phpBB 3.1 "Ascraeus" introduces extensions as another way to add new community-contributed features into a phpBB installation. Extensions are different from MODs in that they do not make any file modifications to the core phpBB files. Instead, extensions are entirely contained in their own directories within the ./ext/ directory in the phpBB root.

Getting Started

For an example extension package, please view the following repository:

Extensions should be located in the phpBB directory as follows: phpBB/ext/<vendor>/<ext>

<vendor> is the author or group of authors of the extension. Note that vendor and extension directory names may ONLY contain numbers and letters. Underscores, dashes, and other characters are NOT permitted. It is perfectly fine to have an extension named iamanextension.


This file is the metadata file containing specific information about your extension. For information on what information goes into the file, please view extension_meta_data.


Each extension should have a file called ext.php at phpBB/ext/<vendor>/<ext>/ext.php. Here is an example file from an example extension phpBB/ext/example/foobar/ext.php:

class phpbb_ext_example_foobar_ext extends phpbb_extension_base

The class is required in order for phpBB to identify your extension as an extension. It also may contain any special (un)installation commands in the methods enable_step(), disable_step() and purge_step(). As it is, these methods are defined in phpbb_extension_base, which this class extends, but you can overwrite them to give special instructions for those cases.

Front-facing Files

While, some extensions perform only background tasks or simply modify a pre-existent page, other extensions may require the inclusion of a front-facing file, which the user is able to access to view information and perform tasks related to the extension. For example, a blog extension needs to display one or more blog entries. To achieve this, we use classes, which are called "controllers". All controllers are mapped with their own routes in the config/routing.yml file. There is one in the main phpBB config directory, but extensions wishing to include a controller must have their own config directory and routing.yml file.

For more information about creating and using a controller for your extension, view the Controller wiki page.