private function renderFields($rendered, $fields)
    {
        foreach ($fields as $field) {
            if (! isset($field['name'])) {
                throw new ControlException("Field must have at least a name!");
            }
            $fieldType = isset($field['type']) ? $field['type'] : 'text';
            $id = isset($field['id']) ? $field['id'] : $field['name'];
            $class = isset($field['class']) ? $field['class'] : $field['name'];
            
            $rendered .= sprintf('<input type="%s" id="%s" class="%s" name="%s"/>',
            		$fieldType, $id, $class, $field['name']);
        }
        
        return $rendered;
    }