2008年8月4日星期一

Re: [fw-mvc] Zend_Controller_Router_Route trouble

-- Yi Tang <ytang@mbira.com> wrote
(on Monday, 04 August 2008, 02:21 PM -0500):
> We're in process of moving to using the Zend Framework. The routing
> mechanism works great, but in order to not change our current URL
> rewrite rules, I'd like to create a route like the following:
>
> category--:id
>
> and have it route the request to the category controller with parameter
> id, so category--2345 will call the category controller with 2345 as the
> value for "id". Is this possible? I tried to put this route in my
> routes config file, but then it would not work.

You'll need to use Zend_Countroller_Router_Route_Regex for this; the
basic route does not allow matching arbitrary characters between or
following slashes.

--
Matthew Weier O'Phinney
Software Architect | matthew@zend.com
Zend Framework | http://framework.zend.com/

没有评论: