2009年4月7日星期二

Re: [fw-mvc] Zend_Paginator does not render the 'page' attribute when using Zend_Controller_Router_Route_Regex

Hey,

I am not sure but i don't see any indication of the 'page' attribute added to the link anywhere. Not in the router regex and not in the forward call.

You will need to pass in a 'page' attribute to the forward call so when forwarding the 'page' attribute will be set.

You might want to check http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.regex

This is not a lot of help i know, But without actually testing this i can't really say more then that.

Vince.

On Wed, Apr 8, 2009 at 4:24 AM, frank.quosdorf <frank.quosdorf@totuba.com> wrote:

The following route is specified in config.ini:

routes.context.type = "Zend_Controller_Router_Route_Regex"
routes.context.route = "context/(.+)"
routes.context.defaults.module = "context"
routes.context.defaults.controller = "index"
routes.context.defaults.action = "index"
routes.context.map.1 = "context"
routes.context.reverse = "context/%s"

and made available in Bootstrap:

$router->addConfig($config, "routes");

After some pre-processing, the request is forwarded to the search controller
of another module:

$context = $request->get("context");
$contextID = $this->findContextID($context); //... pre-processing
return $this->_forward("index", "search", "items");

The search controller lists results and uses Zend_Paginator to render the
pagination. When calling the search controller directly, Zend_Paginator
properly renders the pagination. But, when forwarding the request as
described above, the 'page' attribute does not get set in the paginator's
pagesInRange array. As a result, the url looks like this:

/context/whatever_the_context_is

instead of

/context/whatever_the_context_is/page/[page number]

What do I have to be aware of when using Zend_Paginator in conjunction with
Zend_Controller_Router_Route_Regex?

--
View this message in context: http://www.nabble.com/Zend_Paginator-does-not-render-the-%27page%27-attribute-when-using-Zend_Controller_Router_Route_Regex-tp22941489p22941489.html
Sent from the Zend MVC mailing list archive at Nabble.com.




--
Vincent Gabriel.
Lead Developer, Senior Support.
Zend Certified Engineer.
Zend Framework Certified Engineer.




没有评论: