0

I'm using the search plugin from CakeDC https://github.com/CakeDC/search (works fine so far). I would like to perform a search where two date fields are used to search in a mysql database a between value but I cannot get it working.

How can I do that?

I found no working example and the documentation is confusing me.

--Edit: View code:

[html table stuff]
<td>
    <?php 
    echo $this->Form->input('from', array(
        'type' => 'date',
        //'div' => false,
        'dateFormat' => 'DMY',
        'minYear' => 2013,
        'maxYear' => date('Y'),
        'style' => 'margin-right: 2px; margin-left: 2px',
        'empty' => true,
        'timeFormat' => null,
        'selected' => array(
            'day' => 1,
            'month' => 1,
            'year' => 2013
            ),
        'empty' => false
        ));
    ?>
</td>
<td>
    <?php 
    echo $this->Form->input('to', array(
        'type' => 'date',
        'div' => false,
        'dateFormat' => 'DMY',
        'minYear' => 2013,
        'maxYear' => date('Y'),
        'empty' => true,
        'style' => 'margin-right: 2px; margin-left: 2px',
        'timeFormat' => null,
        'selected' => array(
            'day' => date('D'),
            'month' => date('M'),
            'year' => date('Y')
            ),
        'empty' => false
        ));
    ?>
</td>
[html table stuff]
Nikel Weis
  • 724
  • 10
  • 27
  • depends on if both fields have to be set. or if it suffices that one of them can be left empty (all until / all above). – mark Jul 21 '13 at 20:49
  • Both have to be set. They are set via "selected". I will post view code. – Nikel Weis Jul 21 '13 at 21:07

0 Answers0