Why don't you move the code from index action to admin_search?

On Thu, Jul 2, 2009 at 12:08 PM, mona<[email protected]> wrote:
>
> Dear Friends,
>
>         Can anybody tell me how to send some value through
> response.redirect
> I am making search funtion and that is called admin_search() from
> there when user enters some value then form will redirected to
> admin_index function where my search query is working.
>
> function admin_search() {
>                $this->_adminOnly();
>
>        }
>
>        function admin_index() {
>                $this->_adminOnly();
>                $_SESSION['lastsort'] = $_SERVER['REQUEST_URI'];
> if (! empty ($this->data)) {
>                        $Querystring= trim($this->data['Agent']['search']);
>                $this->paginate['fields'] = array
> ('id','uid','agent','vendor','model','totalhits');
>                $this->paginate['limit'] = 50;
>                $this->Agent->recursive = 0;
>                $this->set('agents', $this->paginate(array(array('verified' =>
> 0,'or'=>'Agent.agent' like "%$Querystring%"))));
>        }
> }
>
>
> In this case my form is posted on admin_index
> But what i wan't is that i want to post my form to admin_search and
> then from there i wan' t to send search string value to admin index
> page so cananybody tell me how to perfor this task this is very
> urgent.
>
> and also can anybody tell me whether this is the write way to send
> value to other function
>
> $this->redirect(array('action'=>'admin_index'),$Querystring);
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" 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