Creating a Plugin
Esta página aún no está disponible en tu idioma.
In order to get started, you first need to setup your Castopod dev environment.
1. Create the plugin folder
You’ll first need to create your plugin folder in
the plugins/
directory.
Using the create command Recommended
To quickly get you started, you can have a folder generated for you using the following CLI command:
👉 You will be prompted for metadata and hooks usage to have a skeleton plugin project generated for you!
Manual setup
-
create a plugin folder inside a vendor directory
Directoryplugins
Directoryacme
Directoryhello-world/
- …
- …
-
add a manifest.json file
Directoryhello-world
- manifest.json
See the manifest reference.
-
add the Plugin.php class
Directoryhello-world
- manifest.json
- Plugin.php
2. Build your plugin
Now that your plugin folder is set, you can start working on your Plugin’s logic by implementing the hooks needed.
Settings forms
You can prompt users for data through settings forms.
These forms can be built declaratively using the settings attribute in your manifest.
This example will generate settings forms at 3 levels:
general
: a general form to prompt data to be used by the pluginpodcast
: a form for each podcast to prompt for podcast specific dataepisode
: a form for each episode to prompt for episode specific data
The data can then be accessed in the Plugin class methods via helper methods taking in the field key: