public function search($url, array $form = array())
    {
        $html = '';
        $form = array_merge(array(
            'name' => 'search',
            'role' => 'search',
            'class' => 'form-horizontal',
            'placeholder' => 'Search',
            'button' => $this->icon('search'),
            'size' => '',
        ), $form);
        $form['method'] = 'get';
        $form['action'] = $url;
        $input = array('class' => 'form-control', 'placeholder' => $form['placeholder']);
        $button = $form['button'];
        $size = $form['size'];
        unset($form['placeholder'], $form['button'], $form['size']);
        $form = new BPForm($form);
        $form->validator->set($form->header['name'], 'required');
        if (!empty($button)) {
            if (strpos($button, '<button') === false) {
                $button = '<button type="submit" class="btn btn-default" title="Search">'.$button.'</button>';
            }
            $html .= '<div class="'.$this->prefixClasses('input-group', array('sm', 'md', 'lg'), $size).'">';
            $html .= $form->text($form->header['name'], $input);
            $html .= '<div class="input-group-btn">'.$button.'</div>';
            $html .= '</div>';
        } else {
            if (!empty($size) && in_array($size, array('sm', 'md', 'lg'))) {
                $input['class'] .= " input-{$size}";
            }
            $html .= $form->text($form->header['name'], $input);
        }

        return $form->header().$html.$form->close();
    }