On 12 abr, 14:18, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> well I really thought I was clear but seems not
>
> a real example is a cms for art galleries
>
> all the galleries need the same basic functionalities but some of them
> might need specific functionalities
>
> all the apps are hosted on the same server and the main (parent) app
> also, basic functionalities are taken care of by the Models/
> Controllers/Views from the main app, specific ones by the Models/
> Controllers/Views of the child app (whether they are new
> functionalities or existing one (in the main app) but overridden by
> the child app).
>
> What I want to do is not to have to duplicate the code in each app
> folder so for the functionalities that are common to all the apps I
> want one and only main parent app dir.
>
> I can do it so far (see previous posts), the only things missing are :
>
> - common js/css/img folder (coming in 1.2)
> - sharing plugins (how do I access a plugin in another app)
> - having the child app app_controller inherit from the parent app (so
> that I don't have to duplicate the app_controller code in each
> app_controller)
>
> hope it is clearer but maybe the logic of it (loading the main app
> files in bootstrap) is not the right one...
>
> thanks
>
> thomas

by bootstrap technique, do you mean using something like this:
http://groups.google.com/group/cake-php/msg/f6d239a654b1463d?dmode=source?

Anyway, a suggestion. Probably someone has done something similar
before.

If you have the following folder structure:
Server
        base_app
                config
                controllers
                        gallery_controller.php
                models
                        gallery.php
                webroot
                app_controller.php
                app_model.php
        template_app
                config
                controllers
                models
                webroot
                app_controller.php
        custom_1 // default install example, no customisation
                config
                controllers
                models
                webroot
        custom_2 // customization example
                config
                controllers
                models
                webroot
                app_controller.php
        custom_3 // customization example
                config
                controllers
                models
                webroot
                app_model.php
        etc.
        cake
        vendors

And define your config such that if the file in each custom app does
not exist, it will inherit or look for the files in template_app that /
might/ do what you want. You would need the folder structure for each
custom_app.

Using the app controller files as an example.

The contents of base_app/app_controller.php would be
class BaseAppController extends Controller {
// actual code
}

The contents of template_app/app_controller.php would be
include (BASE.base_app_controller.php);
class AppController extends BaseAppController {
// nothing
}

The contents of custom_2/app_controller.php would be
include (BASE.base_app_controller.php);
class AppController extends BaseAppController {
// some kind of customization
$this->layout = 'special';
}

I hope this suggestion helps or prompts other thoughts,

regards,

AD


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