Hello gurus!
i've picked up zend framework and being playing with it, and here is a situation i'll like to
achieve.
i have default
and user
modules
, user has a different layout user_layout
that i load in predispatch
of NovelsController
of user modules.i have a small form in the user_layout that post
dates (from and to ) to showAction of NovelsController.
here is the code
<!-- the form inside user_layout -->
<form method="get" action="/user/novels/show">
<table class="font">
<tr>
<td> <label for="to">From:</label></td>
<td class="simple_margin_left"><input type="text" id="from" name="from" size="12"/></td>
</tr>
<tr>
<td> <label for="to">To:</label></td>
<td class="simple_margin_left"><input type="text" id="to" name="to" size="12" /></td>
</tr>
<tr>
<td> </td>
<td></td>
</tr>
<tr>
<td colspan="2" align="center"><button type="submit" style="padding-left:10px; padding-right:10px; margin-left:0px" class="classy">Check</button> </td>
</tr>
</table>
</form>
I use the following to
$input = new Zend_Filter_Input($filters, $validators);
$input->setData($this->getRequest()->getPost());
So far everything works fine i now want to enable pagination to the show.phtml.so i change the form action to get and defined route in my application.ini like so
resources.router.routes.user-show.route = /user/novels/show/:page/:from/:to
resources.router.routes.user-show.defaults.controller = novels
resources.router.routes.user-show.defaults.module = user
resources.router.routes.user-show.defaults.action = show
resources.router.routes.user-show.defaults.page = 1
resources.router.routes.user-show.defaults.from = ""
resources.router.routes.user-show.defaults.to = ""
how can i make the form action follow that rule, because up to now it's just a normal query string with question mark and variable=value.
How can i achieve that?thanks for reading this.