Hi Safi,
> And not all controllers are modules so i do not wish for all
> controllers in /controllers to extend Module controller.
> Only the ones which are "Modules".
> By doing this the code is quite easy to follow and understand which
> parts are responsible for what.
>
> But my problem is the nasty solution of dumping the class definition
> into /app/app_controller.php ...
> All ideas, tips and hints are very welcome!
I think you may have a very hard of it if you go this route, as you're
straying massively from how cake does things. My advice would be to
refactor your app so it fits more with how cakephp works.
sorry, I realise that's not much help, but I don't think you'll get
much help because you're really trying to break cake's conventions,
rather than working within it's confines (it much easier if you do,
trust me!).
cheers,
Jon
>
> On Aug 2, 12:54 am, safl <[EMAIL PROTECTED]> wrote:
> > thx for all the replies.
> >
> > I should have said that i already tried placing a
> > module_controller.php in /app/, that didn't work.
> > When i then let my controllers inside of /controllers extend
> > ModuleController, i get the error "class not found or something like
> > that".
> > Problem is that module_controller.php in /app/module_controller.php
> > (right next to app_controller.php) is not the the include path and not
> > loaded at the right "time" as the basics.php in /cake does.
> > I tried fixing this by adding the /app path to php's include path
> > inside of /app/config/bootstrap.php but that didnt work either.
> >
> > My current solution is that i have simply dumped the class definition
> > inside of /app/app_controller.php.
> > Now i don't even have to say this, but that is one ugly solution :)
> >
> > To be more clear about what i wish to achieve. I wan't my
> > ModuleController to be an extension of AppController.
> >
> > As a design point of view this makes AppController a more "abstract"
> > or "general" class than ModuleController. The AppController contains
> > everything that is required for an "Application Controller", the
> > "Module Controller" extends this functionality and properties and
> > implements stuff which is only needed for "Modules".
> >
> > The application I'm doing is fairly big. I got 11 "Modules"
> > integrated. (Helpdesk, Surveillance, Inventory Management etc..).
> >
> > Therefore i really wan't to split the controller logic into smaller
> > chunks.
> >
> > On Aug 1, 9:33 pm, francky06l <[EMAIL PROTECTED]> wrote:
> >
> > > Hi LS, did not think about this .. but I safi wants to make different
> > > classes inherit from a bunch of "specialized" AppControler, this not
> > > the way .. If all classes inherit from "ModelController", better to
> > > "enhance" AppController itself ..
> > > This is my 2 cents on top :-)
> >
> > > On Aug 1, 9:27 pm, LS <[EMAIL PROTECTED]> wrote:
> >
> > > > My 2 cents:
> > > > Make model_controller.php in the same level as app_controller.php
> > > > make this model_controller declaration:
> > > > class ModelController extends Controller {}
> > > > and this app_controller declaration:
> > > > class AppController extends ModelController {}
> >
> > > > This way, you won't have to change any controller in your application.
> >
> > > > Regards,
> > > > - LS
> >
> > > > On Aug 1, 4:11 pm, francky06l <[EMAIL PROTECTED]> wrote:
> >
> > > > > I think you can place your module_controller.php file at same level of
> > > > > app_controller.php. This should work without problem having you
> > > > > ModuleController extending AppController and other controller
> > > > > extending ModuleController.
> >
> > > > > On Aug 1, 5:54 pm, safl <[EMAIL PROTECTED]> wrote:
> >
> > > > > > Hello,
> >
> > > > > > I would like to have different controller types that are extends of
> > > > > > the basic AppController.
> >
> > > > > > Let's say i got "class ModuleController extends AppController" where
> > > > > > should i then place my "module_controller.php" so my controllers in
> > > > > > /
> > > > > > controllers be able to: "class WhateverController extends
> > > > > > ModuleController" instead of "class WhateverController extends
> > > > > > AppController"?
> > > > > > And without messing with the Cake installation.
> >
> > > > > > The thing is I got a bunch of logic in AppController in beforeFilter
> > > > > > and the use of a couple of components and stuff like that but I only
> > > > > > wan't a subset of my controllers in /controller to inherit these
> > > > > > properties.
> >
> > > > > > And other controllers will very soon like to inherit some other
> > > > > > properties of some other controller type.
> >
> > > > > > regards,
> > > > > > Simon
>
>
> >
>
--
jon bennett
t: +44 (0) 1225 341 039 w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---