'Frankenstyle component names' refers to the naming convention that is used to uniquely identify a Moodle plugin based on the type of plugin and its name. They are used throughout the Moodle code (with a notable exception being the css class names in the themes).
Martin Dougiamas invented the word 'frankenstyle' to describe this naming system which was invented by Petr Škoda.
Frankenstyle component names have a prefix and then a folder name, separated by an underscore.
- The prefix is determined by the type of plugin. For example, the prefix for an activity module is mod.
- The name is the folder name of the plugin, always lower case. For example, the name for Quiz is quiz.
So the frankenstyle component name for the quiz module is mod_quiz.
See Plugin types page for the list of all supported plugin types in Moodle and their frankenstyle prefix.
To get a definitive list in your version of Moodle 2.x, use a small Moodle script with print_object(get_plugin_types());.
Subsystems in Moodle are not plugins themselves but can be referred to using core_xxx where xxx is the subsystem name as defined in get_core_subsystems().
You can see these being used in the @package parameter in phpdocs, or in the webservice function names.
|Core subsystem||Frankenstyle component name|
|My home page||core_my|
Frankenstyle component names are used in:
All plugin functions must start with full frankenstyle prefix. For backwards compatibility modules may also use modulename_ as prefix.
All plugin classes must start frankenstyle prefix, ex: mod_forum_some_class.
All plugin constants must start with uppercase frankenstyle prefix, example MOD_FORUM_XXXX.
All table names for a plugin must begin with its frankenstyle name (after the standard Moodle table prefix).
(The exception to this rule is Moodle activities which (for historical reasons) do not have mod_ in front of the plugin name)
Examples: mdl_local_coolreport, mdl_local_coolreport_users
Plugin configuration table
In the config_plugins table, column plugin, the frankenstyle name is used.
All capabilities for a plugin use the frankenstyle name, except with a / instead of a _.
The main language file for each plugin (with the notable exception of activity modules) is the frankenstyle component name.
It is possible to extend modules without having to change the basic module's code. See Subplugins for details.
Other places (TODO)
- @package declarations in phpdocs, see Coding_style#PHPDoc
- web service function names
- Moodle Plugins database
Please add more as they come up.