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


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to