// Load JForm library jimport('joomla.form.form'); // Load form XML file $form = JForm::getInstance('myform', 'path/to/myform.xml'); // Get a fieldset named "general" $fieldset = $form->getFieldset('general'); // Loop through fields and print out their names foreach ($fieldset as $field) { echo $field->getAttribute('name') . '
'; }
// Load JForm library jimport('joomla.form.form'); // Load form XML file $form = JForm::getInstance('myform', 'path/to/myform.xml'); // Get a fieldset named "contact" $fieldset = $form->getFieldset('contact'); // Get the value of the "name" field $name = $form->getValue('name', 'contact'); // Set the value of the "email" field $form->setValue('email', 'johndoe@example.com', 'contact'); // Render the fieldset echo $form->renderFieldset($fieldset);This example loads a form from an XML file and retrieves a fieldset named "contact". It then gets the value of the "name" field and sets the value of the "email" field. Finally, it renders the fieldset to display on a web page. Based on the syntax and method names used in the examples, it is likely that JForm belongs to the Joomla package library.