Monday, February 8, 2016

Re: $this->render('index');

Is that the whole search method in your controller?

If yes, then the render call is inside the if statement at the beginning and will thus not be invoked due to the return statement just after the if statement.

Enjoy, John

On Saturday, 30 January 2016 06:32:22 UTC+2, Maxwell Ochieng wrote:
I have tried for two days now to figure out why $this->render('index'); is not working on my controller method,here is the controller action I am running $this->render('index');
Thanks.
public function search(){
if($this->request->is('put') || $this->request->is('post')){
return $this->redirect(array(
'?'=>array(
'q'=>$this->request->data('User.searchQuery')
)
));
$this->User->recursive = 0;
$searchQuery=$this->request->query('q');
$this->Paginator->settings = array(
 'User'=>array(
   'findType'=>'search',
 'searchQuery'=> $searchQuery
 )
 );
$this->set('users',$this->Paginator->paginate());
$this->set('searchQuery',$searchQuery);
//$this->autoRender = false;
   $this->render('index');
}
}

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP

---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at https://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/d/optout.

No comments: