diff options
-rw-r--r-- | Readme.md | 52 |
1 files changed, 35 insertions, 17 deletions
@@ -8,12 +8,19 @@ Callable via REST-API ## Directory Structure -- $root - - repositories/ - - $group/ +- config.yaml (main config) +- $contentFolder/ - config/ - - config.toml - - templates/ + - $group/ +- $pluginsFolder/ + - $pluginName/ + - Plugin.php + +### config consists of + +- config/ + - config.yaml + - functions.php ### $group consists of @@ -25,31 +32,42 @@ Callable via REST-API - $form/ - config/ - - fields/ - - _fields.toml - - name.toml - - email.toml - - submissions/ + - entries/ - $year - $month + - $day + - \$year\$month\$day_\$hour\$minute_\$hash.yaml + - fields/ + - _fields.yaml + - email.yaml + - name.yaml ## config -`config.toml` with config values -overwritten by config.toml in $group/config/ -overwritten by config.toml in $form/config/ +adjust $contentFolder and $pluginsFolder path in main config.yaml -### config/templates +`config.yaml` with config values in $contentFolder/config/ +overwritten by config.yaml in $group/config/ +overwritten by config.yaml in $form/config/ -Templates to use when returning a pre-rendered HTML form +`functions.php` with custom code in $contentFolder/config/ +included if exists in subsequent config folders ## REST-API `localhost:3000/$group/$group/$form` -GET ...$form/fields +`GET` `...$form/fields` +`GET` `...$form/entries?dateFrom=$date` + +`POST` `...$form/validate` +`POST` `...$form/submit` + -POST ...$form +## Plugins +1. create `$pluginName` directory in $pluginsFolder +2. create `Plugin.php` with `FlatFileForms\Plugins\$pluginName` namespace and `Plugin` class +3. write code in `__construct` method |