List Info

Thread: Controller noRouteAction()




Controller noRouteAction()
user name
2006-07-27 14:00:43
Derek, since it doesn't contain any secret data, I'll
return to list - maybe 
someone will have additional remarks.

>> Could you describe what you are doing exactly and
how? I would like to
>> understand your needs a bit better.
> I have cases where I require dynamic actions (that
don't exist).
> For that I use __call()

You have misunderstood me here. I have told that the
framework should redirect 
to Index/noRoute instead of throwing an exception in
Action::__call. If you 
override the __call in your controller no exception is being
thrown so 
application flow wouldn't change.

I'll use Allan Vernons code as an example application here:
http://www.vernona.com/MARTEL/subdirMARTEL/postcodes1/
list

If you go to nonexistent controller, ie.:

http://www.vernona.com/MARTEL/subdirMARTEL/postcode
s-bad/list

you get to noRoute. But when you try to load an action, ie.:

http://www.vernona.com/MARTEL/subdirMARTEL/postcode
s/list-bad

exception is thrown (you would see it if error reporting was
turned on ;).
And in my opinion both of those URLs should result in
noRouteAction.

> But I also have cases where I require dynamic
controllers (that don't exist).
> For that I use noRouteAction()

And you still should be able to do that. Every not matched
controller and 
action pair will just lead to noRoute. The difference being
that additionally 
to non existent controller this method would receive also
non existent actions 
from otherwise perfectly good controllers.

> Derek

-- 
Michael Minicki aka Martel Valgoerad | martelaie.pl |
http://aie.pl/martel.asc
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
=-=-=-=-=-=-=-=-=-=
"A good listener is usually thinking about something
else." -- Kin Hubbard
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )