Hallo,

I'm a bit confused, how to integrate Zend_Paginate into my app framework. In
order to use the DbSelect adapter, I need a select object, which is in my
model. In order to display the page numbers I need the view object which I
have in the controller.

In the docu I can't find any examples. The use case in the proposal has this
excample:

$db = new Zend_Db_Adapter_Pdo_Sqlite(array( 
    'dbname' => 'example.sqlite' 
)); 
$sampleData = $db->select()->from('example'); 

// this is an array result set, not a select object...
$paginator  = Zend_Paginator::factory($sampleData); 
..some configuration...
$this->view->pages = $paginator; 

In reality I have this:


$data = $mymodel->getObjectData($someConditions)
$this-view-data = $data;

Should I instantiate the paginator in the model and have then:

$data = $mymodel->getObjectData($someConditions)
$this-view-data = $data;#
$paginator = $mymodel->getPaginator();
$paginator->setView($this->view)
$this->view->pages = $paginator;

The confiuraten of the paginator I would like to provide in the bootstrap
process simelary as in ZYM.

I would like to integrate Zend_Paginate as an configurable feature, which my
model base class should be aware of. My model class provides a list function
wich list data objects based on a passed condition, using
Zend_Db_Table_Select.

Thank you for your advice

Axel
-- 
View this message in context: 
http://www.nabble.com/Zend_Paginate-how-to-integrate--tp18835208p18835208.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to