Plugin directory structure

Plugin directory structure

by Meirza - -
Number of replies: 2

Hi, 

Is there any good sample to structure the plugin directory, yes i have visited the https://docs.moodle.org/dev/Plugin_files page, but it's not answering my question, lets take for example that i want to have helper functions to implement the DRY principle and I'm not sure if it's allowed to create new folder helpers and it will contain some helper files.

Average of ratings: -
In reply to Meirza -

Re: Plugin directory structure

by David Mudrák -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators

It's a good practice to implement all these helpers in auto-loaded classes located either under the classes/ (if you do not use custom namespaces) or under classes/local/ (when you want to put things into custom namespaces).

See https://moodledev.io/general/development/policies/codingstyle#namespaces for reference and examples.

Average of ratings: Useful (4)
In reply to David Mudrák

Re: Plugin directory structure

by Meirza - -
David, thank you for the explanation and the link.