With regarding to Zend Pagination Control's fourth parameter:

Customize wrote:
> 
> 
> What can we pass there as an additional parameters? URL encoded data
> like search form data as an array? Where do we retrieve this fourth
> parameter and how? (view partial script of paginator control? how?)
> 
> 

I have the same application as this user, I want to "carry over" URL
parameters with the pagination control for searching, filtering, and custom
use.

I nearly have this figured out but in the absence of a good example I cannot
get it working.

To test it I have tried this in my script when setting up a
paginationControl:

<?= $this->paginationControl($this->paginator, 'Sliding',
'partials/pagination.phtml', array("search" => "search_text")); ?>

What I actually want to carry over from page to page is a URL parameters
equal to:

?search=search_text&filter=custom_filter&custom=my_custom_command

I thought in my controller I could do this:

$url_params = $this->getRequest()->getParams();
$this->view->url_params = $url_params;  

And then send this somehow as an array to my partial.

In my test for partial I have this (testing on the 'next' link, presumably
I'm going to have to incorporate this on *every* link):

<!-- Next page link -->
        <?php if (isset($this->next)): ?>
                |  "<?= $this- url(array('page' => $this->next, 
$this->search)); ?>">Next
&gt;  |
        <?php else: ?>
                | Next &gt; |
        <?php endif; ?>


Multiple problems:

1. $this->getRequest()->getParams() returns too much info, such as
controller, action and module. I need just my parameters and I don't know
how to do this with Zend.

2. In my test, instead of having the proper URL even for search_text I have:
http://quickstart/data/index/page/2/0/search_text

There is an extra "0" and no "search" thus I am handling this array wrong.

3. My tests only allow one parameter, I would really like to send all three.

I would prefer not to use sessions as per the other suggestions if Zend
already has this built in.

Please assist.
-- 
View this message in context: 
http://www.nabble.com/What-is-the-fourth-parameter-of-pagination-control--tp22051496p24811928.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to