Re: [fw-general] Router, Controller Front, Dispatcher

2007-06-27 Thread Matthew Weier O'Phinney
-- agatone <[EMAIL PROTECTED]> wrote
(on Wednesday, 27 June 2007, 08:54 AM -0700):
> I'm sorry but I had to make this post, cuz I don't know what to read anymore
> and i'm getting more and more lost.
> 
> Problem:
> Let's say I have application at http://exmpl.com/.
> 
> Now this application has several modules:
> http://exmpl.com/news/
> http://exmpl.com/blog/
> http://exmpl.com/gallery/
> etc.
> 
> What I don't understand how passing params thru URL's work. As I seen it
> says default it's something like this
> 
> http://exmpl.com/gallery/id/12/user/15/ - (id = 12, user = 15)
> http://exmpl.com/blog/cat/12/
> http://exmpl.com/blog/id/112/

No, that won't work. The default route is:

[:module/]:controller/:action/*

which means that if you want to pass params via the URL, you need to
specify *each* of the module, controller, and action:

http://exmpl.com/gallery/index/index/id/12/user/15
 module  cntrl actn

A limitation of the '*' wildcard is that all the preceding elements must
be present for it to match.

Another option is to create a route like this:

:module/*

which would allow for the URLs you have above, but would preclude the
idea of :controller/:action or :module/:controller or
:module/:controller/:action as routes.

You may want to rethink your URL schema slightly, and/or create custom
routes for each module.

-- 
Matthew Weier O'Phinney
PHP Developer| [EMAIL PROTECTED]
Zend - The PHP Company   | http://www.zend.com/


[fw-general] Router, Controller Front, Dispatcher

2007-06-27 Thread agatone

I'm sorry but I had to make this post, cuz I don't know what to read anymore
and i'm getting more and more lost.

Problem:
Let's say I have application at http://exmpl.com/.

Now this application has several modules:
http://exmpl.com/news/
http://exmpl.com/blog/
http://exmpl.com/gallery/
etc.

What I don't understand how passing params thru URL's work. As I seen it
says default it's something like this

http://exmpl.com/gallery/id/12/user/15/ - (id = 12, user = 15)
http://exmpl.com/blog/cat/12/
http://exmpl.com/blog/id/112/
etc

Problem is I don't want to write router for every possible path with all
param posibilities. Isn't there any general soultuion whith should parse
params in certain format by default? I've seen, by dumping REQUEST object,
it already knows values of controller, action and module - all i'm  missing
is params.



-- 
View this message in context: 
http://www.nabble.com/Router%2C-Controller-Front%2C-Dispatcher-tf3989103s16154.html#a11326855
Sent from the Zend Framework mailing list archive at Nabble.com.