Wednesday, April 29, 2009

Re: $this->paginate() required?

No, it is not required to call paginate. You could do $this->set
('results', $this->SearchedModel->find(...));

On Apr 29, 1:28 pm, "valentin.olte...@gmail.com"
<valentin.olte...@gmail.com> wrote:
> Sorry, me noob. I forgot to add 'Form' Helper
>
> On Apr 29, 2:43 pm, "valentin.olte...@gmail.com"
>
> <valentin.olte...@gmail.com> wrote:
> > Hi! I have a SearchController with the following index action:
> > function index() {
>
> >                 /* Check if new search occured */
> >                 if (!isset($this->params['url']['q'])) {
> >                         //$this->Session->setFlash('New search');
>
> >                         //$this->paginate();
> >                         $this->render('newsearch');
>
> >                 }
> > .....
>
> > }
>
> > AppController has var $helpers = array('Auth', 'Html');
>
> > The problem is I receive the error Undefined variable: form, but when
> > I uncomment the line "$this->paginate();" it works ok.
> > The questions is it is required to call $this->paginate(); ? because
> > all examples I saw had nothing like this.
>
> > Thanks for help!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

No comments: