Thanks for the tip, Jason.
In thinking about this more (and having almost no familiarity with the
router at this point), I'm wondering if you can do a regex-type matching on
the url in the router, and prefix parameters with something (ie. the "::"
static notation might be a good choice...) that signals the end of the
controller/action inputs and the start of parameters. This way, if you
prefix all params consistently, you're router instruction can set controller
and/or action to default as soon as it sees the presence of your prefix.
Eg:
[URI]/viewer/::collection/photos/::item/38
means:
controller=viewer
action=default //not specified in URL
param1='collection'
value1='photos'
param2='item'
value2='38'
etc...
Not sure if ":" is a valid char in a url, but that would be the general
idea...does anybody have any experience with anything like this?
Jason Webster wrote:
>
> One possible way would be to create a route like this (please forgive
> the laziness of my copy and paste):
>
> <route>schedule/*</route>
>
> <defaults>
> <module>events</module>
> <controller>index</controller>
> <action>index</action>
> </defaults>
>
>
> spaceage wrote:
>> So this Z...C...R approach would route all requests to a single
>> controller
>> and action, no? But what if I want to allow something like this (but not
>> always):
>>
>> [URI]/controller/var1/value1/var2/value2
>>
>> while still allowing the standard:
>>
>> [URI]/controller/action/var1/value1/var2/value2
>>
>>
>>
>> Michał Minicki wrote:
>>
>>> spaceage <> napisał(a):
>>>
>>>
>>>> Is there any way around this, ie. a "magic" way to signal default/index
>>>> for one or both of the controller/action designators and still pass in
>>>> parameters in their place(s) without confusing the router?
>>>>
>>> You are most probably trying to achieve something like below route. I.e.
>>> to
>>> pass all requests to one controller and action and parse all the
>>> parameters
>>> as dynamic var-value pairs. And if so - yes, it's possible.
>>>
>>> $route = new Z...C...R_Route(
>>> '*',
>>> array('controller' => 'default', 'action' => 'index')
>>> )
>>>
>>>
>>>
>>> --
>>> Martel Valgoerad aka Michal Minicki | [EMAIL PROTECTED] |
>>> http://aie.pl/martel.asc
>>> =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>> "Idleness is not doing nothing. Idleness is being free to do anything."
>>> -- Floyd Dell
>>>
>>>
>>>
>>>
>>
>>
>
>
>
--
View this message in context:
http://www.nabble.com/URL-Routing-and-Params-tp19325888p19341501.html
Sent from the Zend Framework mailing list archive at Nabble.com.