Skip to content

Commit

Permalink
Restructure CoreEnroller for top-level form generation (CFM-218) (#357)
Browse files Browse the repository at this point in the history
* Restructure CoreEnroller for top-level form generation (CFM-218)

* Ensure "collect enrollee email" renders (CFM-495)
  • Loading branch information
arlen authored Dec 16, 2025
1 parent f4d559b commit 846e89b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
11 changes: 4 additions & 7 deletions app/templates/EnrollmentFlows/start.inc
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,11 @@ $modelTable = $this->Tab->getModelTableReference($modelsName);
// For now, we just request the enrollee email. We're only called if
// collect_enrollee_email is true, so we don't need to check it, though
// if we ever add more fields to the start form we should.
print $this->element('form/listItem', [
'arguments' => [
'fieldName' => 'enrollee_email',
'fieldOptions' => [
'required' => true
],
$fields = [
'enrollee_email' => [
'required' => true,
'fieldType' => 'string'
]
]);
];

// Any hidden fields??
8 changes: 5 additions & 3 deletions app/templates/EnrollmentFlows/start.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

declare(strict_types = 1);

// Enrollment Flow Start has its own file of fields
$modelsName = $this->getName();
$templatePath = $vv_template_path ?? ROOT . DS . "templates" . DS . $modelsName;
include($templatePath . DS . 'start.inc');
?>

<div class="page-title-container">
Expand All @@ -38,8 +42,6 @@
<?= $this->element('flash') // Flash messages ?>

<?php
// Enrollment Flow Start has its own file of fields
$this->set('vv_fields_inc', 'start.inc');
// Set form edit ability
$this->set('vv_is_editable', true);

Expand All @@ -49,7 +51,7 @@
'type' => 'post',
]);
// Form body
print $this->element('form/unorderedList');
print $this->element('form/unorderedList', ['vv_fields' => $fields]);
// Close the Form
print $this->Form->end();

0 comments on commit 846e89b

Please sign in to comment.