Back to FormModel class

Method __construct

public
__construct
(mixed $config = array(), \Joomla\CMS\MVC\Factory\MVCFactoryInterface $factory = null, \Joomla\CMS\Form\FormFactoryInterface $formFactory = null)
Constructor
Parameters
  • array $config An array of configuration options (name, state, dbo, table_path, ignore_request).
  • \Joomla\CMS\MVC\Factory\MVCFactoryInterface $factory The factory.
  • \Joomla\CMS\Form\FormFactoryInterface $formFactory The form factory.
Since
  • 3.6
-
  • \Exception
Class: FormModel
Project: Joomla

Method __construct - Source code

/**
 * Constructor
 *
 * @param   array                 $config       An array of configuration options (name, state, dbo, table_path, ignore_request).
 * @param   MVCFactoryInterface   $factory      The factory.
 * @param   FormFactoryInterface  $formFactory  The form factory.
 *
 * @since   3.6
 * @throws  \Exception
 */
public function __construct($config = array(), MVCFactoryInterface $factory = null, FormFactoryInterface $formFactory = null)
{
    $config['events_map'] = $config['events_map'] ?? array();
    $this->events_map = array_merge(array('validate' => 'content'), $config['events_map']);
    parent::__construct($config, $factory);
    $this->setFormFactory($formFactory);
}