Note that there are some explanatory texts on larger screens.

plurals
  1. POZend_Paginator: no page number on links on a page with no page number specified by the URL
    primarykey
    data
    text
    <p>Without sticking /1 onto a url is there away to change Zend_Paginator to approach a URL? Currently the user goes to /aaron/studio. Then the user should click through the paging and start accessing URLS such as : /aaron/studio/2</p> <p>I have this rule:</p> <pre><code>$router-&gt;addRoute('studios/page', new Zend_Controller_Router_Route(':id/studio/:page',array('module' =&gt; 'default', 'controller' =&gt; 'studio', 'action' =&gt; 'view'))); </code></pre> <p>If I go-to /aaron/studio/2, the Paginator links correctly to other pages, if i goto /aaron/studio it doesn't link to other pages, just the page its on.</p> <p>What I need todo somehow it make Paginator aware that of its location even without a page in the URL.</p> <p>Heres my controller code if it helps:</p> <pre><code> $page = $this-&gt;_getParam('page', 1); $from = ($page * $this-&gt;clips_per_page) - $this-&gt;clips_per_page; $count = Model_Clip::load_by_type(array('type' =&gt; 'studio_id', 'values' =&gt; $object-&gt;id, 'to' =&gt; 0, 'to' =&gt; COUNT_HIGH, 'count' =&gt; 1, 'order' =&gt; 'd.views DESC')); $paginator = Zend_Paginator::factory($count); $paginator-&gt;setItemCountPerPage($this-&gt;clips_per_page); $paginator-&gt;setCurrentPageNumber($page); $paginator-&gt;setPageRange(25); $this-&gt;view-&gt;paginator = $paginator; </code></pre> <p>Edit, heres my view as requested:</p> <pre><code>&lt;?php if (count($this-&gt;paginator) &amp;&amp; $this-&gt;paginator-&gt;count() &gt; 1): ?&gt; &lt;?php echo $this-&gt;paginationControl($this-&gt;paginator, 'Sliding', 'pagination.phtml', array('translate' =&gt; $this-&gt;translate)); ?&gt; &lt;?php endif; ?&gt; </code></pre> <p>and the partial</p> <pre><code>&lt;div class="pagination-control" style="width: auto; text-align: center; margin: 0 auto"&gt; &lt;div style="width: auto;"&gt; &lt;!-- First page link --&gt; &lt;?php if (isset($this-&gt;previous)): ?&gt; &lt;a href="&lt;?php echo $this-&gt;url(array('page' =&gt; $this-&gt;first)); ?&gt;"&gt;Start&lt;/a&gt; | &lt;?php else: ?&gt; &lt;!-- &lt;span class="disabled"&gt;Start |&lt;/span&gt; --&gt; &lt;?php endif; ?&gt; &lt;!-- Previous page link --&gt; &lt;?php if (isset($this-&gt;previous)): ?&gt; &lt;a href="&lt;?php echo $this-&gt;url(array('page' =&gt; $this-&gt;previous)); ?&gt;"&gt; Previous&lt;/a&gt; | &lt;?php else: ?&gt; &lt;!-- &lt;span class="disabled"&gt; Previous |&lt;/span&gt; --&gt; &lt;?php endif; ?&gt; &lt;!-- Numbered page links --&gt; &lt;?php foreach ($this-&gt;pagesInRange as $page): ?&gt; &lt;?php if ($page != $this-&gt;current): ?&gt; &lt;a href="&lt;?php echo $this-&gt;url(array('page' =&gt; $page)); ?&gt;"&gt;&lt;?php echo $page; ?&gt;&lt;/a&gt; &lt;?php else: ?&gt; &lt;span class="chosen"&gt;&lt;?php echo $page; ?&gt;&lt;/span&gt; &lt;?php endif; ?&gt; &lt;?php endforeach; ?&gt; &lt;!-- Next page link --&gt; &lt;?php if (isset($this-&gt;next)): ?&gt; | &lt;a href="&lt;?php echo $this-&gt;url(array('page' =&gt; $this-&gt;next)); ?&gt;"&gt;Next &lt;/a&gt; | &lt;?php else: ?&gt; &lt;!-- &lt;span class="disabled"&gt;| Next |&lt;/span&gt; --&gt; &lt;?php endif; ?&gt; &lt;!-- Last page link --&gt; &lt;?php if (isset($this-&gt;next)): ?&gt; &lt;a href="&lt;?php echo $this-&gt;url(array('page' =&gt; $this-&gt;last)); ?&gt;"&gt;End&lt;/a&gt; &lt;?php else: ?&gt; &lt;!-- &lt;span class="disabled"&gt;End&lt;/span&gt; --&gt; &lt;?php endif; ?&gt; &lt;p&gt; &amp;nbsp; Page &lt;?php echo $this-&gt;current; ?&gt; of &lt;?php echo $this-&gt;last; ?&gt; &lt;/p&gt; &lt;/div&gt; &lt;p class="clear"&gt;&lt;/p&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload