use Joomla\CMS\Form\Form; $form = Form::load('path/to/form.xml');
use Joomla\CMS\Form\Form; $db = JFactory::getDbo(); $query = $db->getQuery(true) ->select('params') ->from('#__extensions') ->where('element = ' . $db->quote('com_foobar')); $db->setQuery($query); $params = $db->loadResult(); $form = Form::load($params);
use Joomla\CMS\Form\Form; $formData = array( 'fieldname' => 'John Doe', 'fieldemail' => 'john@example.com', ); $form = Form::load($formData);The JForm load function is located in the 'joomla/form' package library, which also contains other classes and functions related to form creation and handling in Joomla!.