Problem with Paging and forward with Zend Framework 1

Asked

Viewed 109 times

0

Use ZF1 and I’m having trouble using the _forward(), The reason is that if I redirect it to a paginated page, the url gets the method of the action that was submitted. Well, for example, if I have a pagination and each item has the delete button with its ID and I click to delete and after a forward on the page the URL that was .../index/consultar/pagina/3 stays ../index/apagar?idRegistro=196 and if I change page ../index/apagar/pagina/5 leaving the pattern, maybe I’m not doing it right.

But follow the code code code. (I’m not the most professional programmer yet, so don’t take too much notice of my bad code sometimes. )

http://pastebin.com/RJgABKUW - Indexcontroller

http://pastebin.com/hAvX8sTC - paginacao.phtml

http://pastebin.com/nqnbw6su - consult.phtml

And I have this problem with paging also because if I do a search specifying some data (filter) there it brings the first page with data and number of pages equivalent to pagination in the search. But if I go to page 2 it kind of changes the pagination as if searching all the data.

1 answer

0

Try sending your search form via GET instead of using POST because the data will remain in the URL when paginationControl uses the url helper to build the url of the other pages.

In the case of forward, use the url helper to build the links of the delete button.

<a href="<?php echo $this->url(array('controller' => 'minha-controller', 'action' => 'excluir'), null, false); ?>">Excluir</a>

This way, the submitted form parameters will persist in the URL.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.