Back to Form class

Method reset

public bool
reset
(mixed $xml = false)
Method to reset the form data store and optionally the form XML definition.
Parameters
  • bool $xml True to also reset the XML form definition.
Returns
  • bool True on success.
Since
  • 1.7.0
Class: Form
Project: Joomla

Method reset - Source code

/**
 * Method to reset the form data store and optionally the form XML definition.
 *
 * @param   boolean  $xml  True to also reset the XML form definition.
 *
 * @return  boolean  True on success.
 *
 * @since   1.7.0
 */
public function reset($xml = false)
{
    unset($this->data);
    $this->data = new Registry();
    if ($xml) {
        unset($this->xml);
        $this->xml = new \SimpleXMLElement('<form></form>');
    }
    return true;
}