[Solar-talk] "Forwarding" Controller
Rodrigo Moraes
rodrigo.moraes at gmail.com
Wed Oct 18 11:07:27 PDT 2006
On 10/10/06, Matt M. wrote:
> I've got a very simlified version of what I call a "forwarding" controller,
> and I think it'd be very easy to implement into Solar. [...] Basically, there is a single entry
> point, and anything added to the path_info string is inspected as a possible
> controller. It allows you to do routing and nesting. A url like:
> /admin/product/54 would create a root controller, an admin controller and a
> product controller. Only executing the "execute" method on the product
> controller. There are hooks that let you change the response of a child
> controller.
Matt,
I've played with the forwarding controller for a while today and it
seemed a very very *very* nice idea. It seems amazingly effective,
simple and flexible, and provides a solution to "modularize" and
divide the controllers into smaller ones (this is a subject that
appears here from time to time).
The most interesting point I think is how it can "decouple" a group of
controllers. Normally our approach is to subclass an app to modularize
it. The forwarding approach makes possible to have standalone
controllers (or "modules") that work for two or more apps. Some of us
have been wondering about how to have independent controllers working
with other main controller.
I wonder if forward controllers again and again could make the app
slow, but normally we don't have more than 2 or 3 levels, so I don't
think this would be a problem. What do you think?
I have some suggestions to make the API more solar-like, but I'll use
it a bit more before I drop the ideas.
Really nice work, Matt! :)
rodrigo
---------------------------------------------------------------------
Solar has now a Community Wiki: solarphp.org
---------------------------------------------------------------------
Join the #solarphp IRC channel on freenode.org
---------------------------------------------------------------------
More information about the solar-talk
mailing list