CoreFiles by mySites.guru
FormFactory.php41 lines, 880 bytes, from Joomla_4.2.0-beta3-Beta-Full_Package.zip
Raw History Compare with 4.2.0-beta2
md5
30983143f1323949fc9d70896fbbacb4
sha1
0b5ee2f5739207cf40b2ec9df3e83336893651fc
sha256
4ccf3d6fca4695d90b08722fcf2915e51bec62908b82d22f8c1e7e9798d7e06a
<?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;

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 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.