plugin name and underscore?

plugin name and underscore?

by Martin H -
Number of replies: 2

Hi,

I read about naming conventions and the Frankenstyle naming.

But I couldn't find if a plugin name is alowed (discouraged) to contain underscore.

for example my_first_plugin. so the frankenstyle name would be [enrol | auth | ...]_my_first_plugin


Average of ratings: -
In reply to Martin H

Re: plugin name and underscore?

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Underscores in plugin names will work, but are very much discouraged.

So the plugin should be called mod_myfirstplugin (or enrol_myfirstplugin, etc)

In reply to Davo Smith

Re: plugin name and underscore?

by Marina Glancy -
Picture of Core developers Picture of Moodle HQ Picture of Moodle Workplace team Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

agree with Davo.

The reason for discouraging is the "special" behavior of activity modules - very often they are allowed to use the plugin name without the "mod_" prefix where all other plugin types should use the prefix. Imaging the activity module that is called "mod_enrol_counter" - the shorter name "enrol_counter" may be mistaken for the enrolment plugin.