Zend Framework 2 Paginator + TableGateway

前端 未结 5 1110
悲哀的现实
悲哀的现实 2021-01-03 12:02

How to use the database mapper with the paginator?

I\'m having a bit trouble understanding how I implement the DbSelect paginator using the code below (right now i

5条回答
  •  悲&欢浪女
    2021-01-03 12:29

    but I'm having trouble getting a Select object out from my TableGateway without duplicating my query code. Is there an easy way to solve this problem?

    You can get the select object inside you NewsContentsTable class like this:

    $this->getSql()->select();
    

提交回复
热议问题