2007/5/6, Andrew Yager <[EMAIL PROTECTED]>:

Hi,

I'm looking for an easy way to do two things.

Problem No 1:

If I have a route with the path /foo/:var1/:var2 - the only time it
will be matched is when a URL is received in the form '/foo/bar/lah'.

I can set a 'default' value for :var1 and :var2 when creating the
route, so I would like to be able to request the URL '/foo' and
have :var1 and :var2 automatically set from the default values.

Is this possible?

Problem No 2:

I have occasion to want to be able to call /foo/:var1 where var1 is
an arbitary string containing text and the '/' character - e.g. /foo/
lah/de/dah and have it match, and then the controller break :var1 up.

Is this possible? I haven't been able to get it to match again.

Thanks,
Andrew


Hello Andrew.
The second argument in Zend_Controller_Router_Route constructor is array of
default values. Just look at example from manual, it explains everything:
$router->addRoute('user',new
Zend_Controller_Router_Route('user/:username', array('controller' =>
'user', 'action' => 'info'))
);

With '/' - You can simply change it to %2f in every link, and then apply
urldecode on argument. Nothing better comes to my mind, but that one should
work.
--
Greetings,
Sebastian Poreba

Reply via email to