Creating a form

Now we need to create the JForm that Joomla! will use to load this data. This is just an XML file that defines the fields we are going to use on our form.

The form XML file

Create the folder forms in your model folder, then create the file /administrator/components/com_folio/models/forms/folio.xml. Don't forget to include an index.html file in this new folder.

<?xml version="1.0" encoding="utf-8"?> <form> <fieldset> <field name="id" type="text" default="0" label="JGLOBAL_FIELD_ID_LABEL" readonly="true" class="readonly" description="JGLOBAL_FIELD_ID_DESC"/> <field name="title" type="text" class="inputbox" size="40" label="JGLOBAL_TITLE" description="COM_FOLIO_FIELD_TITLE_DESC" required="true" /> <field name="alias" type="text" class="inputbox" ...

Get Learning Joomla! 3 Extension Development - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.