When an array of values is passed to "choices" this turns into a numeric-indexed array, e.g.
'choices' => [
'Blue',
'Green',
'Yellow',
]
Would return 0 if Blue was chosen, 1 if Green was chosen, etc.
Ideally this would return Blue for blue, etc.
This requires removing the zero-indexing on a simple array passed to choices. Either as an option or the default.
Example:
app/Forms/SubmitCfviResourceForm.php
->add('types', ChoiceType::class, [
'help' => '',
'rules' => ['required'],
'choices' => [
'Worksheet/Activity' => 'Worksheet/Activity',
'Checklist' => 'Checklist',
'Lesson plans and Schemes of work' => 'Lesson plans and Schemes of work',
'Templates' => 'Templates',
'Handbook/information guide' => 'Handbook/information guide',
'Tracking documents' => 'Tracking documents',
'Case studies/personal stories' => 'Case studies/personal stories',
'Multimedia resources' => 'Multimedia resources',
'Networks/community/support' => 'Networks/community/support',
'Government documentation/resources' => 'Government documentation/resources',
'CFVI Training and Information' => 'CFVI Training and Information',
'Books' => 'Books',
'Guidance' => 'Guidance',
'External Link' => 'External Link',
],
'expanded' => true, 'multiple' => true,
])
Ideally this would be:
->add('types', ChoiceType::class, [
'help' => '',
'rules' => ['required'],
'choices' => [
'Worksheet/Activity',
'Checklist',
'Lesson plans and Schemes of work',
'Templates',
'Handbook/information guide',
'Tracking documents',
'Case studies/personal stories',
'Multimedia resources',
'Networks/community/support',
'Government documentation/resources',
'CFVI Training and Information',
'Books',
'Guidance',
'External Link',
],
'expanded' => true, 'multiple' => true,
])
When an array of values is passed to "choices" this turns into a numeric-indexed array, e.g.
Would return 0 if Blue was chosen, 1 if Green was chosen, etc.
Ideally this would return Blue for blue, etc.
This requires removing the zero-indexing on a simple array passed to choices. Either as an option or the default.
Example:
app/Forms/SubmitCfviResourceForm.php
Ideally this would be: