Caveat: This document was authored by someone who has not written a plugin yet. It is his effort to use a plugin to figure out and document how plugins are written. Please correct any inaccuracies that you find.
In this document, pseudo names will be used that you should replace with names that you create. These self explanatory names are:
Remember that to “work”, a plugin needs to not only execute correctly (including being tested) as any code does, but it must be able to be installed and uninstalled correctly. Plugins need to be written in the directory
your_project/app/vendors/plugins/plugin_name
This will be abbreviated to plugin_root. (Note that Rails plugins are in a different location: your_project/vendors/plugins/plugin_name.)
Following is the directory structure and a list of the basic files for your plugin. We have deleted some lines required by some, but not all, plugins so that the essence of a plugin may be more easily seen. This document was created using the Admin plugin as an example. You may want to reference it. (Suggestion:
tree
The line numbers reference list items that explain the entry:
.
`-- plugin_name
1 |-- LICENSE
2 |-- MAINTAINERS
3 |-- README
4 |-- TODO
5 |-- generators
| `-- plugin_name_scaffold
| |-- USAGE
| |-- plugin_name_scaffold_generator.php
| `-- sintags_templates
| `-- <files>
6 |-- installer
I | |-- plugin_name_files
| | |-- app
| | | |-- controllers
| | | | |-- plugin_name
| | | | | `-- <files>
| | | | `-- plugin_name_controller.php
| | | |-- helpers
| | | | |-- plugin_name
| | | | | `-- <files>
| | | | `-- plugin_name_helper.php
| | | |-- installers
| | | | `-- plugin_name_plugin_installer.php
| | | |-- models
| | | | `-- <files>
| | | `-- views
| | | |-- plugin_name
| | | | |-- <model_name>
| | | | | `-- <files>
| | | `-- layouts
| | | `-- plugin_name.tpl
| | |-- public
| | | |-- images
| | | | `-- plugin_name
| | | | `-- <files>
| | | `-- stylesheets
| | | `-- plugin_name
| | | `-- <files>
| | `-- test
| | |-- fixtures
| | | |-- app
| | | | |-- installers
| | | | | `-- plugin_name_plugin_installer.php
| | | | `-- models
| | | | `-- <files>
| | | `-- data
| | | `-- plugin_name
| | | `-- extensions.yaml
| | `-- unit
| | `-- app
| | `-- models
| | `-- <files>
II | `-- plugin_name_installer.php
7 |-- makelos
`-- test
`-- plugin_name.php
name, email and title
The title should describe your function with regard to this plugin. For example:
Bermi Ferrer Martinez <bermi-a.t-akelos-d.ot-co.m> Lead developer