Here's one method (Cake 1.2):

Create a form in your view:
<form id='find_form'>
<fieldset>
<legend><label for='find'>find</label></legend>
<input id='find' name='find' type='text' class='input'> <input
type='submit' value='go' class='button'/>
</fieldset>
</form>

And change the index method of your controller to:

        function index() {

                $this->Programme->recursive = 0;

                $params = $this->params['url'];

                if (!array_key_exists("find", $params)) {

                        $this->set('programmes', $this->paginate());

                }
                else {

                        $this->set('programmes', 
$this->paginate(array("Programme.name LIKE
'{$params['find']}%'")));

                }

        }

I'm still a n00b when it comes to cake so there is probably a better
way to create the paginate parameter, but this works for me.

Hope this helps.


On Oct 23, 10:51 am, inma <[EMAIL PROTECTED]> wrote:
> Hello,
>
>  I'm looking for component or helper to filter/search/paginate
> results. I need it for version 1.1.15 (not version 1.2).
>
>  I want something exactly like 
> thishttp://www.javascriptkit.com/script/script2/tablefilter.shtml,
> but I need to  refresh data from database when the filter or the
> pagination are applied, and this script doesn't do it.
>
> Thanks in advance.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to