5-Minute Quickstart
This quickstart follows the Aegean Voyages (aegeanvoyages.example) charter inquiry workflow in site/modules/Forms/examples/real-world/.
-
Create the form from a stencil or YAML blueprint
Copy
site/modules/Forms/examples/real-world/charter-inquiry.yamlintosite/forms/charter-inquiry.yaml, or generate a starter form withmake:form:Terminal window php vendor/bin/wire make:form charter-inquiry \--title="Aegean Charter Inquiry" \--stencil=quote \--steps=2 \--db \--json -
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,]); -
Or attach a
FieldtypeFormsfield to a page templateCreate a field of type
FieldtypeForms(e.g.,inquiry_form), add it to yourcharter-pagetemplate, select Aegean Charter Inquiry in the page editor, and output<?= $page->inquiry_form ?>(whenrenderModeFormattedis'markup'). -
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','marketing_consent' => '1',], ['enforceCsrf' => true]);if ($result->ok) {// $result->submissionId, $result->redirectUrl, $result->editUrl, $result->deleteUrl} -
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.