Hmm. Odd. Go here and scroll to the bottom of the page:

http://lawrence.sds5.com/esociety/web/

You'll see these links, created by sfPager:

« < 1 - 2 > »

But click on the 2, and it doesn't work. You're still on the front
page.

Most of my code is copy-n-paste of the code snippets on the Symfony
site. Not sure what is up.

In the indexSuccess.php template I have this:

<p>
        <?php if ($pager->haveToPaginate()): ?>
                <hr />

                <?php echo link_to('&laquo;', 'content/showNews?page='.$pager-
>getFirstPage()) ?>
                <?php echo link_to('&lt;', 'content/showNews?page='.$pager-
>getPreviousPage()) ?>
                <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
                <?php echo ($page == $pager->getPage()) ? $page : link_to($page,
'content/showNews?page='.$page) ?>
                <?php if ($page != $pager->getCurrentMaxLink()): ?> - <?php 
endif ?>
                <?php endforeach ?>
                <?php echo link_to('&gt;', 'content/showNews?page='.$pager-
>getNextPage()) ?>
                <?php echo link_to('&raquo;', 'content/showNews?page='.$pager-
>getLastPage()) ?>
        <?php endif ?>
</p>




And in the actions class, I have this:

  public function sendDataToPager($class, Criteria $c, $peerMethod="")
{
    // 02-12-09 - Lets do the pagination.
    // Lets go with 30 results per page
    // This is for all of the above list actions that have a lot to
show
    if (!$this->howManyToPage) $this->howManyToPage = 30;
    $pager = new sfPropelPager($class, $this->howManyToPage);
    if ($peerMethod) $pager->setPeerMethod($peerMethod);
    $pager->setCriteria($c);
    //Set the first page to 1
    $pager->setPage($this->getRequestParameter('page', 1));
    $pager->init();
    $this->pager = $pager;
  }



The code has worked before, in other contexts, so I'm unclear why it
is not working now.


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

Reply via email to