[Solar-talk] "Area" based front controller

Rodrigo Moraes rodrigo.moraes at gmail.com
Sun Jun 10 03:20:20 PDT 2007


Hey everybody,
I've added to SVN a extended Solar_Controller_Front which I think will
be useful in many cases (and I hope not only for me :). It's an "area"
based front controller:

    http://dev.tipos.org/browser/branches/N/Tipos/Controller/Front/Area.php

Basically, it loads from the database info about the app that should
be executed. So:

   http://domain.com/area1

... will look in the database for an area named "area1" and execute
the "default_app" value it has set. A bit more, it will work the same
if you use subdomains:

   http://area1.domain.com

It works like the default routing mechanism in SVN, but is dynamic and
extend it a bit. Actually, you still can route things in the front
controller config (SVN) and map, for example,
http://area1.domain.com/myapp to another desired app. The loaded area
is registered so you can use it later in the app, no matter if it is
running its default app or not.

Let me know if you find it useful or have ideas to improve this
scheme. Or let me know if you *don't* think it is useful or have ideas
to make it worst. Haha. :)

-- rodrigo


More information about the solar-talk mailing list