package QBit::WebInterface::Controller::BEMHTML::Form::Field::checkbox;

use qbit;

use base qw(QBit::WebInterface::Controller::Form::Field);

sub process {
    my ($self, $controller) = @_;
    $self->SUPER::process($controller);
    $self->{'value'}   = $controller->request->param($self->{'name'});
    $self->{'checked'} = defined($controller->request->param($self->{'name'}));
}

sub as_html {
    my ($self) = @_;

    return ${$self->form->controller->_process_template('common/form/checkbox.bem.tt2', vars => {field => $self})};
}

1;
