How to use the subform field type
Besides developing our own fields in Joomla!, we can also create complex fields by combining the standard form fields provided. This is a powerful feature we get from using the subform
field in our forms. The subform
field allows us to include forms as fields of another form.
In our case, we can use the subform
field to add documents to our projects with a name and a description of our Simple Project Management extension.
Let’s start by adding the subform
definition to the src/component/admin/forms/forms.xml
file by adding this code:
<field name="attachments" type="subform" label="COM_SPM_PROJECT_ATTACHMENTS" multiple="true" layout="joomla.form.field.subform.repeatable" > <form> ...