Hi,
  There is a regression in the behavior of the haveToPaginate() function

I am using 1.1.7 and I just noticed a bug.

Bug:
*The pager links do not appear when one selects the last page  and the
number of results are inferior to the pagination limit.*

The haveToPaginate function returns false when it used to return true. This
causes the pagination links to disappear at the end.

Please let me know if this is the desired behavior and if not I will try to
post a patch a.s.a.p

Thanks

Sincerely,
-Hassen Ben Tanfous

PS: I am using the sfPropelPager to initiate the pager

Here is some code:

-----------------
$this->pager = new sfPropelPager('UserFavorite', sfConfig ::
get('app_favorites.listfavorites.pagination.limit'));
        $this->pager->setCriteria($c);


        $this->pager->setPage($this->getRequestParameter('page', 1));
        $this->pager->init();
-------------------------------
<?php use_helper ('Javascript') ?>


*<?php if ($pager->haveToPaginate()): ?>*

  <?php echo
link_to_remote(image_tag(sfConfig::get('sf_admin_web_dir').'/images/first.png',
array('border' => "0", 'align' => 'absmiddle', 'alt' => __('First'), 'title'
=> __('First'))), array (
      'update' => $update_id,
      'url' => $link . '?page=1&' . $params
  )) ?>
  <?php echo
link_to_remote(image_tag(sfConfig::get('sf_admin_web_dir').'/images/previous.png',
array('border' => "0", 'align' => 'absmiddle', 'alt' => __('Previous'),
'title' => __('Previous'))), array (
      'update' => $update_id,
      'url' => $link . '?page='.$pager->getPreviousPage() . '&' . $params
  )) ?>

  <?php foreach ($pager->getLinks() as $page): ?>
    <?php if ($page != $pager->getPage()): ?>
        <?php echo link_to_remote ($page, array (
            'update' => $update_id,
            'url' => $link . '?page='.$page . '&' . $params
        )) ?>
    <?php else: ?>
        <?php echo $page ?>
    <?php endif; ?>

  <?php endforeach; ?>

  <?php echo
link_to_remote(image_tag(sfConfig::get('sf_admin_web_dir').'/images/next.png',
array('border' => "0", 'align' => 'absmiddle', 'alt' => __('Next'), 'title'
=> __('Next'))), array (
      'update' => $update_id,
      'url' => $link . '?page='.$pager->getNextPage() . '&' . $params
  )) ?>

  <?php echo
link_to_remote(image_tag(sfConfig::get('sf_admin_web_dir').'/images/last.png',
array('border' => "0", 'align' => 'absmiddle', 'alt' => __('Last'), 'title'
=> __('Last'))), array (
  'update' => $update_id,
      'url' => $link .'?page='.$pager->getLastPage(). '&' . $params
  )) ?>

<?php endif; ?>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to