CoreFiles by mySites.guru
FormFactory.php45 lines, 982 bytes, from Joomla_4.4.4-Stable-Full_Package.zip
Raw History Compare with 4.4.3
md5
8a18731f9d9de98a40d2f0bca9648201
sha1
962e4b595f50207b1039d8c580b39d4162653ea8
sha256
4634c238bd2439d4a4d6843ec6fa4899a3ab879e65bdcde4f3e55ae9a9ae6fae
<?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;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
 * 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 = []): Form
    {
        $form = new Form($name, $options);

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

        return $form;
    }
}

The same content is in 214 releases, Joomla 4.2.7-rc1 to 6.2.1-rc1. See them all, or every version of this file.