How Symphony detects and loads extensions automatically.
The Extension File Structure is a set of layout and naming conventions for extensions that enables them to be automatically detected and loaded by Symphony. You must follow these conventions when creating an extension.
Extensions should be structured as follows. Note that the only required files are extension.driver.php
and extension.meta.xml
. The remaining directories and files can be included as needed.
yourextension/
assets/
sample.js
sample.css
content/
content.index.php
content.sample.php
data-sources/
datasource.sample.php
events/
event.sample.php
fields/
field.sample.php
lang/
lang.de.php
lang.es.php
lib/
yourphplibs.php
text-formatters/
formatter.sample.php
extension.driver.php
LICENSE
README
Though not actually used for auto-inclusion, placing CSS, JavaScript, and image files in an assets directory is a Symphony convention.
The files in the content
directory are autoincluded and used to render back-end pages. The file content.sample.php would render a page at /symphony/extension/yourextension/sample
. content.index.php is viewable at /symphony/extension/yourextension
.
Any data sources to be provided by an extension must be placed here for auto-inclusion.
Any events to be provided by an extension must be placed here for auto-inclusion.
Any fields to be provided by an extension must be placed here for auto-inclusion.
Any localization dictionaries to be provided by an extension must be placed here for auto-inclusion.
Like the assets
folder, the lib
folder is not actually used for auto-inclusion but is conventionally used to store custom library files used by the extension.
Any text formatters to be provided by an extension must be placed here for auto-inclusion.
The extension driver, used to initiate, enable, uninstall, and upgrade an extension and to subscribe to [delegates](/docs.getsymphony.com/concepts/extensions/delegates.html}}. This file is required.
An XML file that follows the Symphony Extension Metadata Schema to provide information about the extension, its version history, and its release notes. Both Symphony itself and other APIs, like the one at [SymphonyExtensions.com], use this.
A text file detailing the license(s) used by the extension. Note that Symphony uses the MIT License, so it is recommended (but not required) that you use the same or a compatible license.
The extension's README file. Conventionally contains basic information (extension name, version, and release date), developer information (name, email, and website) and installation and usage notes. Because most Symphony extensions live on GitHub, Markdown is the conventional way to format these files but is not a requirement.