public function __construct($action = null, $method = 'post', array $fields = null, $indent = null)
{
// Set the form's action and method.
$this->action = null !== $action ? $action : $_SERVER['REQUEST_URI'];
$this->method = $method;
// Create the parent DOM element and the form child element.
parent::__construct(null, 'utf-8', null, $indent);
$this->form = new Child('form', null, null, false, $indent);
$this->form->setAttributes(array('action' => $this->action, 'method' => $this->method));
$this->addChild($this->form);
if (null !== $fields) {
$this->setFields($fields);
}
}