Jump to content

Recommended Posts

Hi.

 

I am working on a script that I think would have a modular design, meaning it would have a directory, that each subdirectory would be a new modular area.

 

 

For Example this script would have a plug in directory let's call it mysite.com/members/

 

and I have some directories in them

mysite.com/members/core/

mysite.com/members/profile/

mysite.com/members/ideabin/

 

 

The core directory automatically is all the core of the script, it takes care of all the maintance stuff such as database, sessions ect,this is the only category that can't be turned off or is mandatory.  the rest of the directories are configurable to be able to turn them off or on thru the core module.

 

Now I throw in a template system and I have it setup like this

 

mysite.com/skins/classic/global

mysite.com/skins/classic/core

mysite.com/skins/classic/profile

mysite.com/skins/classic/ideabin

 

all the templates are smarty .tpl 's

 

I am discovering that I might have made a major error is designing this this.. because modules can be written by other authors, and are mainly self contained only relying on the core module to do it's job.

 

The problem is that If I change the skin to another selection let's say,  classic2 

 

mysite.com/skins/classic2/global

 

that the other modules would not be able to access anything in classic2 because it's not there.

 

In this type of step would it be wise to  keep different skins in the module directory ?  I don't think I have ever seen anything like this before.. meaning in each module in the settings area you would have to select a skin for that module. (skins are basicly just html tables and colors)

 

Is this a better solution ?  I would love to hear some advise on this.

 

Also would this be called a modular design ?  If not what pattern would it be called ?

 

Thanks,

Dave

 

Link to comment
https://forums.phpfreaks.com/topic/107304-questions-on-a-modular-design/
Share on other sites

It's always a good idea to separate your media files from your controlling php files. For example, you can use a www directory for templates and non-www for coding stuff. In the non-www you have folders for each plugin. In the www there are also folders for each plugin. Each plugin has to maintain it's "own" directory.

 

/non-www/members/core (e.g. controller.php and group.php)

/non-www/members/profile (e.g. controller.php and profile.php)

/non-www/skins/core (e.g. controller.php and template.engine.php)

/www/members/core/ (don't know what to place here)

/www/members/profile (e.g. profile.tpl and profile.edit.tpl)

/www/skins/classic/ (e.g. core.tpl)

 

etc

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.