[Solar-talk] "Forwarding" Controller
Matt M.
goodieboy at gmail.com
Tue Oct 10 04:25:09 PDT 2006
Hi,
I've been working on a framework that is similar to Konstrukt:
http://konstrukt.dk/introduction.html
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. I don't have the time
to do this myself, but if any of you were interested in seeing how it works
I could post the code and/or examples. 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. The mapping is done by a simple array:
A URL of /admin/product/54
Root Controller
public $map = array('admin' => array('Controller_Admin'));
Controller_Admin
public $map = array('product' => array('Controller_Admin_Product', 'item'))
Controller Product
public function do_item(){
echo $this->getSubspaceParam(0);
// would print 54
}
What do you guys think?
- Matt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.killersoft.com/pipermail/solar-talk/attachments/20061010/7b6e6ce4/attachment.html
More information about the solar-talk
mailing list