### Install PHP Dependencies with Composer Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/5_developers/0_demo.md Installs all required PHP dependencies, including Kirby 4, DreamForm, and other utility plugins like DotEnv and Ray, using Composer. This command fetches and sets up all necessary packages for the project. ```bash composer install ``` -------------------------------- ### Start PHP Development Server Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/5_developers/0_demo.md Initiates the PHP development server, making the DreamForm site accessible locally, typically at `http://localhost:8000`. This allows for local testing and development. ```bash composer start ``` -------------------------------- ### Clone DreamForm Plainkit Repository Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/5_developers/0_demo.md Clones the `dreamform-plainkit` repository from GitHub into a new directory named `df-plainkit` and then navigates into that directory, preparing the environment for further setup. ```bash git clone https://github.com/tobimori/dreamform-plainkit df-plainkit && cd df-plainkit ``` -------------------------------- ### Configure Manual DreamForm Installation with YAML Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/1_setup/0_installation.md For manual installation, create a forms.txt (or forms.en.txt) file in your content/forms directory and add this YAML content to define the UUID for the forms page. ```yaml Uuid: forms ``` -------------------------------- ### Install Kirby DreamForm via Composer Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/1_setup/0_installation.md Use Composer, the recommended method, to install the Kirby DreamForm plugin by running this command in your terminal. ```bash composer require tobimori/kirby-dreamform ``` -------------------------------- ### Example PHP Configuration for Kirby DreamForm Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/1_setup/2_configuration.md Demonstrates how to configure Kirby DreamForm settings within the `site/config/config.php` file. This example sets a secret from an environment variable, changes the submission mode to HTMX, disables debug, customizes layouts, and defines available guards. ```php // site/config/config.php return [ 'tobimori.dreamform' => [ 'secret' => fn () => env('DREAMFORM_SECRET'), 'mode' => 'htmx', 'debug' => false, 'layouts' => ['1/1', '1/2, 1/2', '1/3, 1/3, 1/3'], 'guards' => [ 'available' => ['csrf', 'honeypot', 'turnstile'] ] ] ]; ``` -------------------------------- ### Configure Kirby DreamForm for Headless CMS Setup Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/1_setup/3_advanced-configuration.md Set up Kirby DreamForm to work seamlessly in a headless CMS environment where the site's URL is configured as '/'. DreamForm automatically uses the `HTTP_HOST` server variable as a fallback for referer validation, ensuring secure form submissions even when `$site->host()` returns empty, which is common in headless setups. ```php // site/config/config.php return [ 'url' => '/', // Headless setup 'tobimori.dreamform' => [ // DreamForm will automatically use HTTP_HOST for referer validation ] ]; ``` -------------------------------- ### Example HTML structure of a DreamForm form Source: https://github.com/tobimori/kirby-dreamform/blob/develop/docs/5_developers/2_styling.md This HTML snippet provides an example of the default structural output of a DreamForm form. It illustrates the nesting of elements like form, error, row, column, field, label, input, textarea, select, and button, showing how different form elements are organized within the DreamForm's rendering. ```html