-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 I'd suggest that you extend the dispatcher and check inside there, if an overring controller exists (and also make sure, that it extends the original controller). Then additionally, cache the result of the check (memcached if possible) so you avoid too many disk stats. ................................... : ___ _ ___ ___ ___ _ ___ : : | \ /_\ / __| _ \ _ (_) \ : : | |) / _ \\__ \ _/ / | |) | : : |___/_/:\_\___/_| |_|_\_|___/ : :........:........................: : Web : http://www.dasprids.de : : E-mail : [email protected] : : Jabber : [email protected] : : ICQ : 105677955 : :........:........................:
jlevy schrieb: > Or perhaps it's the most basic... > > Allow me to give you some background. > > The directory structure of my application has gone through various different > incarnations over time. The current directory structure is pretty much the > final form I intend on going with. Here's what I've got: > > application/ > /modules/ > /models/ > /helpers/ > /plugins/ > extensions/ > /client_1 > /client_2 > > The rationale behind this structure is quite simple: Some of our clients > like to (or will soon be) writing their own controllers, views, models, etc. > We determined the safest way to do this was to create a directory outside of > the main application code, and set up a jailed FTP system for the users to > connect to and deposit their code. (The old way had client modules resident > in the applications/modules directory, this caused headaches galore) > > Anyway. Now that you have some understanding of the basic directory > structure, I'd like to inchworm toward the real question: "What is the best > way to override controllers in the default module for particular calls?" IE: > The default module (which is housed underneath application/modules/default), > contains about 2 dozen controllers. For example: > - application/modules/default/userController.php > - application/modules/default/productController.php > etc. > In some situations, a client may wish to 'override' a default controller, > say, > extensions/client_1/controllers/userController.php > >>>> Note: userController.php extends Default_UserController.php <<< > > What I'm trying to figure out is this: Presently, I can route to an > 'overridden' controller thus: http://foo.server.com/client_1/user/index. > This works great. But what I want to do, and I think this is set up in my > bootstrapper, is "detect" if that userController exists in the > client_1/controller director, thus, providing an override. Ie: Instead of > http://foo.server.com/client_1/user/index -- I want > http://foo.server.com/user/index. > > Right now, this simply routes the client to the default User controller. > > I'm having a devil of a time trying to determine what to do to get the ZF to > actually route to the extensions/client_1/controller/userController ... > > If anyone can point out some obvious idiocies in my question, please, let me > know. I'll be watching this thread like a Nun at Sunday School. > > Thanks! > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAko2YGcACgkQ0HfT5Ws789C4JwCfaboMtmYdWGvvrW171iNOAUpS vl0AoJxnHsn7vztZZpPpu4wHCWc5WDD/ =llPb -----END PGP SIGNATURE-----
