Back to Form class

Method __construct

public
__construct
(mixed $name, array $options = [])
Method to instantiate the form object.
Parameters
  • string $name The name of the form.
  • array $options An array of form options.
Since
  • 1.7.0
Class: Form
Project: Joomla

Method __construct - Source code

/**
 * Method to instantiate the form object.
 *
 * @param   string  $name     The name of the form.
 * @param   array   $options  An array of form options.
 *
 * @since   1.7.0
 */
public function __construct($name, array $options = [])
{
    // Set the name for the form.
    $this->name = $name;
    // Initialise the Registry data.
    $this->data = new Registry();
    // Set the options if specified.
    $this->options['control'] = $options['control'] ?? false;
}