protected function createInput($type, $name = null, $value = null, $attr = null)
    {
        if($type == 'textarea')
            $input = new Input\Textarea($name);
        else
            $input = new Input\Input($type, $name);

        if($name)
            $input->attr('id', $name);

        if($value)
            $input->value($value);
        else if(isset($this->data[$name]))
            $input->value($this->data[$name]);

        if($attr)
            $input->attr($attr);

        if(isset($this->override[$name]))
            $input->override($this->override[$name]);

        return $input;
    }