diff --git a/src/Controller/Component/SearchComponent.php b/src/Controller/Component/SearchComponent.php index 66d4526..d6521f1 100644 --- a/src/Controller/Component/SearchComponent.php +++ b/src/Controller/Component/SearchComponent.php @@ -36,7 +36,6 @@ class SearchComponent extends Component 'operator' => 'LIKE', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => null, ], 'options' => false diff --git a/src/View/Helper/SearchHelper.php b/src/View/Helper/SearchHelper.php index 5b8bbca..652e340 100644 --- a/src/View/Helper/SearchHelper.php +++ b/src/View/Helper/SearchHelper.php @@ -61,10 +61,10 @@ public function filterForm($filters = [], $options = []) foreach ($filters as $field) { // if field is select-box because of the options-key if ($field['options']) { - $html .= $this->Form->select($field['column'], $field['options'], $field['attributes']); - } else { - $html .= $this->Form->input($field['column'], $field['attributes']); + $field['attributes']['options'] = $field['options']; } + $html .= $this->Form->input($field['column'], $field['attributes']); + $html .= ' '; } // end diff --git a/tests/TestCase/Controller/Component/SearchComponentTest.php b/tests/TestCase/Controller/Component/SearchComponentTest.php index ff5f938..8a5e192 100644 --- a/tests/TestCase/Controller/Component/SearchComponentTest.php +++ b/tests/TestCase/Controller/Component/SearchComponentTest.php @@ -85,7 +85,6 @@ public function testAddFilter() 'operator' => 'LIKE', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => null ], 'options' => false diff --git a/tests/TestCase/View/Helper/SearchHelperTest.php b/tests/TestCase/View/Helper/SearchHelperTest.php index 18da369..9881055 100644 --- a/tests/TestCase/View/Helper/SearchHelperTest.php +++ b/tests/TestCase/View/Helper/SearchHelperTest.php @@ -44,7 +44,6 @@ public function setUp() 'operator' => 'LIKE', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => 'title' ], 'options' => false @@ -55,7 +54,6 @@ public function setUp() 'operator' => '=', 'attributes' => [ 'label' => false, - 'type' => 'text', 'placeholder' => 'category', 'empty' => true ], @@ -88,7 +86,7 @@ public function testFilterForm() $this->assertContains('