class Form extends Widget
{
+ var $enctype = null;
+
/**
* Show the form
*
function show()
{
- $this->out->elementStart('form',
- array('id' => $this->id(),
- 'class' => $this->formClass(),
- 'method' => 'post',
- 'action' => $this->action()));
+ $attributes = array('id' => $this->id(),
+ 'class' => $this->formClass(),
+ 'method' => 'post',
+ 'action' => $this->action());
+
+ if (!empty($this->enctype)) {
+ $attributes['enctype'] = $this->enctype;
+ }
+ $this->out->elementStart('form', $attributes);
$this->out->elementStart('fieldset');
$this->formLegend();
$this->sessionToken();
$this->out->hidden('token', common_session_token());
}
-
/**
* Name of the form
*
{
}
-
/**
* Visible or invisible data elements
*
function action()
{
}
-
+
/**
* Class of the form.
*
function formClass()
{
- return 'form';
+ return 'form';
}
}