Skip to content

5-Minute Quickstart

This quickstart follows the Aegean Voyages (aegeanvoyages.example) charter inquiry workflow in site/modules/Forms/examples/real-world/.

  1. Create the form from a stencil or YAML blueprint

    Copy site/modules/Forms/examples/real-world/charter-inquiry.yaml into site/forms/charter-inquiry.yaml, or generate a starter form with make:form:

    Terminal window
    php vendor/bin/wire make:form charter-inquiry \
    --title="Aegean Charter Inquiry" \
    --stencil=quote \
    --steps=2 \
    --db \
    --json
  2. Render the form in any ProcessWire template

    <?php namespace ProcessWire;
    $forms = Forms::requireInstance($wire);
    // Optional availability check (schedule windows, caps, per-IP quotas)
    $closed = $forms->checkFormAvailability('charter-inquiry', $input->ip());
    if ($closed !== null) {
    echo '<p>' . $sanitizer->entities($closed) . '</p>';
    return;
    }
    echo $forms->render('charter-inquiry', [
    'theme' => 'modern', // 'default' | 'modern' | 'bare'
    'sourcePageId' => $page->id,
    'ajaxEnabled' => true,
    ]);
  3. Or attach a FieldtypeForms field to a page template

    Create a field of type FieldtypeForms (e.g., inquiry_form), add it to your charter-page template, select Aegean Charter Inquiry in the page editor, and output <?= $page->inquiry_form ?> (when renderModeFormatted is 'markup').

  4. Programmatic submission & step validation (optional)

    <?php namespace ProcessWire;
    $result = $forms->submit('charter-inquiry', [
    'yacht_class' => 'gulet',
    'embarkation_port' => 'gocek',
    'guest_count' => 8,
    'weekly_budget' => 14700,
    'full_name' => 'Claire Beaumont',
    'email' => '[email protected]',
    'marketing_consent' => '1',
    ], ['enforceCsrf' => true]);
    if ($result->ok) {
    // $result->submissionId, $result->redirectUrl, $result->editUrl, $result->deleteUrl
    }
  5. Triage submissions and survey results in Setup -> Forms

    Open Setup -> Forms -> Submissions to view incoming inquiries in Table or Kanban mode, or open Surveys & Polls to inspect aggregated yacht-class distributions and average budgets.

Next steps