>
> What does $paginator->setView($view) do vs $this->view->paginator
> = $paginator; ?


They serve two different purposes.  You do not need to call setView() if you
use the ViewRenderer, but you always need to assign the paginator to the
view.

-Matt

On Sun, Nov 2, 2008 at 9:19 PM, frank.quosdorf <[EMAIL PROTECTED]>wrote:

>
> as suggested in the manual
> (
> http://framework.zend.com/manual/en/zend.paginator.usage.html#zend.paginator.rendering
> ),
> I am "...setting the default view partial, default scrolling style, and
> view
> instance, to eliminate the calls to PaginationControl completely":
>
> Zend_Paginator::setDefaultScrollingStyle('Sliding');
>
> Zend_View_Helper_PaginationControl::setDefaultViewPartial('my_pagination_control.phtml');
> $paginator->setView($view);
>
> The last line does not have an effect on the rendering. Furthermore, I have
> to explicitly assign the $paginator to the view as otherwise, nothing is
> rendered. In a controller, I have defined:
>
>        $paginator = Zend_Paginator::factory($result); // with $result being
> an instance of array
>        $paginator->setItemCountPerPage(5);
>        $paginator->setPageRange(5);
>
> $paginator->setCurrentPageNumber($this->getRequest()->getParam("page"));
>
>        $this->view->paginator = $paginator; // if this is commented,
> nothing is rendered
>
>        Zend_Paginator::setDefaultScrollingStyle("Sliding");
>
>
> Zend_View_Helper_PaginationControl::setDefaultViewPartial("pagination_control.phtml");
>        $paginator->setView($this->view); // has no effect on the rendering
> if commented
>
> In the view script, I have defined:
> <?php if (count($this->paginator)): ?>
> <ul>
> <?php foreach ($this->paginator as $item): ?>
>  <li><?= $item; ?></li>
> <?php endforeach; ?>
> </ul>
> <?php endif; ?>
>
> <?= $this->paginator; ?>
>
> What does $paginator->setView($view) do vs $this->view->paginator =
> $paginator; ?
> --
> View this message in context:
> http://www.nabble.com/Zend_Paginator%3A-%24paginator-%3EsetView%28%24view%29-has-no-effect-tp20297479p20297479.html
> Sent from the Zend Framework mailing list archive at Nabble.com.
>
>

Reply via email to