diff --git a/app/templates/EnrollmentFlows/start.inc b/app/templates/EnrollmentFlows/start.inc index b4941bc5a..6026703ea 100644 --- a/app/templates/EnrollmentFlows/start.inc +++ b/app/templates/EnrollmentFlows/start.inc @@ -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?? diff --git a/app/templates/EnrollmentFlows/start.php b/app/templates/EnrollmentFlows/start.php index 7dd28ede7..3c7066083 100644 --- a/app/templates/EnrollmentFlows/start.php +++ b/app/templates/EnrollmentFlows/start.php @@ -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'); ?>
@@ -38,8 +42,6 @@ element('flash') // Flash messages ?> set('vv_fields_inc', 'start.inc'); // Set form edit ability $this->set('vv_is_editable', true); @@ -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();