sheevazz / searchable-behaviour-for-cakephp

Automatically exported from code.google.com/p/searchable-behaviour-for-cakephp
0 stars 0 forks source link

Fatal error: Call to a member function prev() on a non-object #21

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hello everyone,
I've installed searchable behaviour, build the index and so far everything
works.
My problem is that whenever I hit one of the paginator links I get an error
like this:

Undefined variable: paginator [APP/views/my_search/index.ctp, line 63]
Fatal error: Call to a member function prev() on a non-object in
.../app/views/my_search/index.ctp on line 63

Controller part:
$term = $this->data['Search']['search'];

$this->SearchIndex->searchModels(array('Blog','Comments',MORE HERE ...));

$this->paginate = array(

                'limit' => 2,
 // Just to make sure it paginates 
                'conditions' =>  "MATCH(SearchIndex.data) AGAINST('$term'
IN BOOLEAN MODE)"

            );

$this->set('term', $term);      

$this->set('searchResults', $this->paginate('SearchIndex'));

View part (pagination only):

<div class="pagination">  
<ul>  
<li><?php echo $paginator->prev(); ?></li> 
<li><?php echo $paginator->numbers(); ?></li> 
<li><?php echo $paginator->next(); ?></li>  
<li class="count">Currently browsing page: <?php echo
$paginator->counter(); ?></li> 
</ul>
</div>

I would very much appreciate If someone can put me in the right direction.

Thanks in advance,
Marcos

Original issue reported on code.google.com by marcosmo...@gmail.com on 24 Sep 2009 at 8:45