$form = new JForm('myform'); $formName = $form->getName(); echo $formName; // Output: "myform"
$form = JForm::getInstance('myform'); $formName = $form->getName(); echo $formName; // Output: "myform"This example uses the getInstance method to retrieve an existing form with the name "myform". We then use the getName method to get the form's name, which is "myform". Package Library: Joomla! CMS - Joomla\CMS\Form\Form.