Tag: symfony 1.4 Doctrine Pagination

Symfony 1.4 Doctrine Pagination

Doctrine Pagination is made very simple . public function executeIndex(sfWebRequest $request) { $this->pager = new sfDoctrinePager(‘TableName’, sfConfig::get(‘app_max_jobs_on_homepage’); $this->pager->setQuery(Doctrine::getTable(‘TableName’)->createQuery(‘a’)); $this->pager->setPage($request->getParameter(‘page’, 1)); $this->pager->init(); } Success page <?php foreach ($pager->getResults() as $post): ?><div> <?php if($post->getTitle()) { echo link_to($post->getTitle(), ‘news/fullstory?expand=’.$post->getId(),’class=”mhead”‘); } ?> <?php if($post->getDn2()!=”)

Tagged with: ,
Top