public function getWrapper($wrapper, $attr)
    {
        $type = '';
        if (! empty($attr['type'])) {
            $type = ' ' . $attr['type'];

            if ((isset($attr['type']) && $attr['type'] == 'select') && in_array('multiple', $attr)) {
                $type .= ' multiselect';
            }
        }

        $defaults = array(
            'tag' => 'div',
            'class' => 'input' . $type
        );

        $wrapperAttr = array_merge(
            $defaults,
            $wrapper
        );

        // double check for the presence of a tag element
        $tag = $wrapperAttr['tag'];
        unset($wrapperAttr['tag']);

        return array(
            'tag' => $tag,
            'attr' => $wrapperAttr
        );
    }