> > I think the run mode should only be taken from path_info when explicitly
> > requested by the rule (e.g. /foo/:app/:rm ).
>
> I guess my concern is how do you automate the selection of run mode in
> the dispatcher if it can be anywhere (or not at all). is :rm a special
> variable declaration or is each app module required to know something
> about the dispatch table in order to select the right run mode? This
> is an interesting question.

Yes, we've been assuming that :rm is a special placeholder name that
sets current_run_mode, not $self->param('rm').  


> > For most apps I want the run mode set, but every so often I have an
> > exception, e.g:
> >
> >     /get/path/to/file.html
> >     /get/other/path/to/other/file.html
> >
> > For an app like this, I don't want the run mode being set to 'path' or
> > 'other'.  And I also don't want to be forced to make my URLs
> > artificially longer by including a dummy run mode:
> >
> >     /get/view/path/to/file.html
> >     /get/view/other_path/to/other_file.html
>
> Sorry I'm not following what you mean here.

You were asking whether run_modes should automatically be parsed from
URLs if they are left out of the dispatch parameters and I was
illustrating why that would be a Bad Idea (tm).

Obviously the URL /get/some/file/somewhere.htm wants $rm to be left
unset and $path to be set to '/some/file/somewhere.html'.  It doesn't
want $rm set to 'some' and @params set to ('file', 'somewhere.html').

There are other reasons why it's a bad idea to *always* parse the run
mode from the URL (Rob pointed some out), but this is the reason that
hits home for me, since I actually have apps that work like this.


Michael



---
Michael Graham <[EMAIL PROTECTED]>


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.erlbaum.net/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to