Note: You are currently viewing documentation for Moodle 3.3. Up-to-date documentation for the latest stable version of Moodle is probably available here: Plugin skeleton generator.

Plugin skeleton generator: Difference between revisions

From MoodleDocs
(Initial version)
 
(Add installation instructions)
Line 13: Line 13:
#Proceed to ''Administration > Site administration > Development > Generate plugin skeleton''
#Proceed to ''Administration > Site administration > Development > Generate plugin skeleton''
#Fill in the various plugin features then click on the "Download plugin skeleton button"
#Fill in the various plugin features then click on the "Download plugin skeleton button"
[[Image:tool_pluginskel_first_page.png|thumb|600px|center|Generate plugin skeleton]]
[[Image:tool_pluginskel_first_page_v1.png|thumb|600px|center|Generate plugin skeleton]]


To generate the plugin skeleton by using the comand line interface:
To generate the plugin skeleton by using the comand line interface:
Line 19: Line 19:
#Invoke the command line script at "cli/generate.php":
#Invoke the command line script at "cli/generate.php":
     php cli/generate.php --recipe=recipe.yaml
     php cli/generate.php --recipe=recipe.yaml
==Installation==
This plugin has been tested to work with Moodle 3.1 and newer. There are no guarantess it will work with earlier versions.
General installation procedures are those common for all Moodle plugins: [[Installing_plugins|Installing plugins]].
When downloading the plugin from the git repository [https://github.com/mudrd8mz/moodle-tool_pluginskel tool_pluginskel] there are several options available: cloning the repository, downloading the zip file and extracting it or using the zip file for the plugin install interface accessible at ''Administration > Site administration > Plugins > Install plugins''.
If you choose to clone the repository, then you need to clone it into MOODLE_ROOT_DIRECTORY/admin/tool/pluginskel:
    git clone https://github.com/mudrd8mz/moodle-tool_pluginskel MOODLE_ROOT_DIRECTORY/admin/tool/pluginskel
replacing MOODLE_ROOT_DIRECTORY with the actual Moodle installation root directory path. The zip file should be extracted to the same location.
Keep in mind that cloning the repository also creates a hidden .git directory, which you may not want on live servers.
'''Note''': If you decide to use the install plugin interface don't forget to rename the folder inside the archive to ''pluginskel''.

Revision as of 07:48, 21 August 2016

Generate plugin skeleton

The plugin will generate the skeleton files needed for a specific plugin type. The full functionality of the plugin can be accessed either via a web interface or the command line script.

To generate a skeleton plugin via the web interface:

  1. Proceed to Administration > Site administration > Development > Generate plugin skeleton
  2. Fill in the various plugin features then click on the "Download plugin skeleton button"
Generate plugin skeleton

To generate the plugin skeleton by using the comand line interface:

  1. Create a recipe file in the YAML format, either by writing it from scratch or by editing the template recipe located at "cli/example.yaml" (recommended)
  2. Invoke the command line script at "cli/generate.php":
   php cli/generate.php --recipe=recipe.yaml

Installation

This plugin has been tested to work with Moodle 3.1 and newer. There are no guarantess it will work with earlier versions.

General installation procedures are those common for all Moodle plugins: Installing plugins.

When downloading the plugin from the git repository tool_pluginskel there are several options available: cloning the repository, downloading the zip file and extracting it or using the zip file for the plugin install interface accessible at Administration > Site administration > Plugins > Install plugins.

If you choose to clone the repository, then you need to clone it into MOODLE_ROOT_DIRECTORY/admin/tool/pluginskel:

   git clone https://github.com/mudrd8mz/moodle-tool_pluginskel MOODLE_ROOT_DIRECTORY/admin/tool/pluginskel

replacing MOODLE_ROOT_DIRECTORY with the actual Moodle installation root directory path. The zip file should be extracted to the same location.

Keep in mind that cloning the repository also creates a hidden .git directory, which you may not want on live servers.

Note: If you decide to use the install plugin interface don't forget to rename the folder inside the archive to pluginskel.