ZF-6805: Zend_View_Helper_PaginationControl should render with no partial set

Issue Type: Improvement Created: 2009-05-26T02:49:00.000+0000 Last Updated: 2009-06-09T07:48:53.000+0000 Status: Postponed Fix version(s): Reporter: Dalibor Karlovic (dkarlovi) Assignee: Matthew Ratzloff (mratzloff) Tags: - Zend_Paginator

Related issues: Attachments:


Currently, when you don't set the partial for paginationControl, it just throws an exception. But, IMHO, you could render a decent paginator without it being required. Say

<pre class="highlight"> 

<a href="#">«</a>
  <a href="#">‹</a>
  <a href="#">1</a>
  <a href="#">2</a>
  <a href="#">5</a>
  <a href="#">›</a>
  <a href="#">»</a>

This would lower the requirements for using it.


Posted by Dalibor Karlovic (dkarlovi) on 2009-05-26T02:56:32.000+0000

The params needed for this would be the HTML for the first/last, prev/next combo, the name of the URL param (which could default to "page") for the url() view helper and the route name (defaulting to... well, "default"). Maybe, if feeling really generous, one could supply an "attribs" param which would get embeded to


ul> itself (defaulting to array("class" => "paginator"); I reworked the paginationControl helper by adding __toString() and render() as paginationControl() returns $this.

This would enable cuszomizing the paginator rendering per instance, like:

<pre class="highlight">
echo $this->paginationControl()->setPaginator($this->paginator)->setParamName('p')->setParamRoute('articles');

Posted by Jurrien Stutterheim (norm2782) on 2009-05-30T20:36:39.000+0000

Postponing this issue. In the early prototypes of Zend_Paginator this features was available, but after giving the feature a lot of thought we opted to include good examples in the manual instead. If something like this is attempted it should probably be done in a separate view helper to not clutter the current one too much.

Posted by Dalibor Karlovic (dkarlovi) on 2009-05-31T02:08:45.000+0000

A separate helper is fine, but then you have an issue of "Which is the proper one?" Why was the rendering without partials droped?

Posted by Matthew Ratzloff (mratzloff) on 2009-06-08T07:46:28.000+0000

The examples in the documentation exist for this very reason, and I think the documentation is pretty clear in this respect. I think a separate view helper would be more confusing.

Posted by Dalibor Karlovic (dkarlovi) on 2009-06-08T08:56:12.000+0000

I don't get the reasoning behind your comment. The component should be able to render itself without requiring an additional view file, much like for example Zend_Form or Zend_Navigation. I don't understand why you'd go for breaking this pattern here and opt for "it all in the doc" stance.

Posted by Dolf Schimmel (Freeaqingme) (freak) on 2009-06-08T09:37:28.000+0000

I kinda agree here, (sorry Norm2782). I don't see the problem in providing a few standard partials or view helpers with ZF (those of the documentation maybe? :D).

Posted by Matthew Ratzloff (mratzloff) on 2009-06-08T14:13:46.000+0000

Dalibor: To be fair, Zend_Navigation was only recently released, so prior to the inclusion of Zend_Paginator in 1.6 only one component was released that did this. One component is not really a pattern, and therefore Zend_Paginator is not really "breaking" anything. :-)

Dolf: I'd more than likely be the one to implement this issue; that's why I assigned it to myself.

After considering a simpler way of solving this (simply including a default view partial under Zend/View/Helper/PaginatorControl/default.phtml) I will re-mark this as postponed until I get some time to do it. However, a patch (with unit tests) will help speed up the time to completion if one of you would like to submit one. It would be appreciated.

Posted by Dalibor Karlovic (dkarlovi) on 2009-06-09T00:07:27.000+0000

Well, the "pattern" might have been an overstatement, but atleast you've changed the WONTFIX attitude so it kinda worked. :) Anyway, as you're proposing adding the first view partial (AFAIK), maybe the core devs should discuss the best place for it (naming scheme, etc.). I could submit a patch for this, it'd get my feet wet.

Posted by Matthew Ratzloff (mratzloff) on 2009-06-09T07:48:52.000+0000

That's a good point. I'll raise the issue on the mailing list.

Have you found an issue?

See the Overview section for more details.


© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.