This module provides a CLI interface only. Here are some examples of generating code:
sudo icingacli scaffoldbuilder build --name yourmodulename
In case you want to have a custom theme for IcingaWeb2 shipped with your module you can use:
sudo icingacli scaffoldbuilder build --name yourmodulename --theme yourthemename
In case you want to have a one directory filemanager shipped with your module you can use:
sudo icingacli scaffoldbuilder build --name yourmodulename --filemanager YES
IniRepositories are ini-based "databases". You should have already seen this when generating resources in IcingaWeb2 or if you use the elastic search module. This example generated code for users and groups. Users are shown in a table view and groups are shown in a grid view.
sudo icingacli scaffoldbuilder build --name yourmodulename --iniconfigs "user:table, group:grid"
For Sql-Databases scaffoldbuilder can render the Model/View/Controller files for you.
This example generated code for users and groups. Users are written to the table yourmodulename_user
and
groups are written to the table yourmodulename_group
. Since User is a MySQL keyword you should always use a table prefix.
sudo icingacli scaffoldbuilder build --name yourmodulename --dbconfigs "user:user, group:group"
If you prefer a different table prefix you can specify this with --tableprefix
but by default it is the modulename.
sudo icingacli scaffoldbuilder build --name yourmodulename --dbconfigs "user:user, group:group" --tableprefix "tbl_"
IcingaWeb2 does not come with Sqlite Database migration so this helper allows you to change your database inside the module itself. Remove this code when in production.
sudo icingacli scaffoldbuilder build --name yourmodulename --sqlite YES
IcingaWeb2 allows you to add multiple module paths here. For example:
/usr/share/icingaweb2/modules:/home/icingaweb2/modules
To generate modules in this second path use:
sudo icingacli scaffoldbuilder build --name yourmodulename --modulepath /home/icingaweb2/modules
In earlier version sof PhpStorm (< 2024) it was not possible to upload in a "sudo" way, so if you use the --dev parameter the permissions of your module will be set to 0777.
To generate modules in this second path use:
sudo icingacli scaffoldbuilder build --name yourmodulename --dev YES