I use the paginator within my Model, my model will then either return a rowset or a paginator object. I see the paginator as a domain service and therefore reasonable for my Model to return, its not prefect but saves having to write your own model aware paginator adapter.
2009/3/22 Marko Korhonen <marko.korho...@datafisher.com>: > > hi, > > I try to figure out how should I make my controller,model and paginator > stuff so it makes sense. > > Let's make a simple example: > > I want to get list of stuff from Model and throw it to my Paginator: > > public function listAction() > { > $model = new Zebra(); > > // Get 10 zebras at the time and paginate > $zebras = $model->getSlowZebrasSoICanEatThem(10, $this->_getParam("page", > 1)); > > // OK, should Model return rowset, select object or paginator ??? > > // if it's paginator, I can send it to view > $this->view->paginator = $zebras; > > // if it's select object, I must declare my Paginator and set select > object for it > ...set paginator... > > // If it's rowset... ehm, what I can do with it? can Paginator eat rowset? > > } > -- > View this message in context: > http://www.nabble.com/Controller%2C-Model-and-Paginator%2C-and-I-want-my-Girls..-ehh%2C-Controllers-thin-tp22645201p22645201.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- ---------------------------------------------------------------------- [MuTe] ----------------------------------------------------------------------