Sunday, March 29, 2009

Paginate Find All Results

I have the following Find query to retrieve search results from my DB:

$this->set(
'results',
$this->Feed->FeedContent->find(
'all',
array(
'conditions' => 'MATCH( name, keywords, description, encoded )
AGAINST ( \'' . $keyword . '\')',
'fields' => '*, MATCH( name, keywords, description, encoded )
AGAINST( \'' . $keyword . '\' ) AS score '
)
)
);


I'd like to paginate the results but I absolutely cannot find a way
without generating errors. I can't alter my paginate array I
immediately declared in my Controller because that array is also
controlling other actions I have set up perfectly. I also do not want
to throw this code into another model as I see it as way too much
hassle to relate that Controller to the ones I have set up now.

Does anyone know about where I can find what I need to get this query
paginated? I hate to have to write additional coding to do what
hoepfully will be easier than it seems with Cake.

Thanks
--~--~---------~--~----~------------~-------~--~----~
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: