CoreFiles by mySites.guru
FormFactory.php42 lines, 847 bytes, from Joomla_4.2.0-alpha3-dev-Development-Full_Package.zip
Raw History Compare with 4.2.0-alpha2
md5
a55ba9a786f2bdb73127aec055b99bd3
sha1
9e1315cc0ef5284f0a1d61732e4f03c30fde0748
sha256
34a76c1d9eac64662365975d7e1f46b24005c2e74dc24341314000f87e0bb950
<?php
/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2017 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Form;

\defined('_JEXEC') or die;

use Joomla\Database\DatabaseAwareTrait;

/**
 * Default factory for creating Form objects
 *
 * @since  4.0.0
 */
class FormFactory implements FormFactoryInterface
{
	use DatabaseAwareTrait;

	/**
	 * Method to get an instance of a form.
	 *
	 * @param   string  $name     The name of the form.
	 * @param   array   $options  An array of form options.
	 *
	 * @return  Form
	 *
	 * @since   4.0.0
	 */
	public function createForm(string $name, array $options = array()): Form
	{
		$form = new Form($name, $options);

		$form->setDatabase($this->getDatabase());

		return $form;
	}
}

The same content is in 3 releases, Joomla 4.2.0-alpha3 to 4.2.0-beta2. See them all, or every version of this file.