CMS: Multiple modules causes duplicate Class/Functions
Posted: Mon May 22, 2006 10:11 am
Hey,
I'm currently working on a small, yet powerfull CMS system that is compltly modular. The way inwhich it will work is that the Admin can choose which modules go into what 'sector' of the template file. Then, the requested module ( Which comes from the URL, EG index.php?mod=news ) is then included into the main content area ( Specified by the template file ).
Each module is wraped in a class called mod{modname} ( EG modNews ), I thought this was a good way to do it at first - BUT if the admin has specified that he/she wants the News module in say the left sidebar area and then the requested module is also the news module ( index.php?mod=news ) this will cause duplicate Class/Functions and causes a fatal error.
How do other CMS's allow duplicate modules in this way? I've spent days trying to think how I can make these two ( or more ) identical modules unique but I can't.
Please can someone help me, if you don't understand please say and I will try to explain it better.
I'm currently working on a small, yet powerfull CMS system that is compltly modular. The way inwhich it will work is that the Admin can choose which modules go into what 'sector' of the template file. Then, the requested module ( Which comes from the URL, EG index.php?mod=news ) is then included into the main content area ( Specified by the template file ).
Each module is wraped in a class called mod{modname} ( EG modNews ), I thought this was a good way to do it at first - BUT if the admin has specified that he/she wants the News module in say the left sidebar area and then the requested module is also the news module ( index.php?mod=news ) this will cause duplicate Class/Functions and causes a fatal error.
How do other CMS's allow duplicate modules in this way? I've spent days trying to think how I can make these two ( or more ) identical modules unique but I can't.
Please can someone help me, if you don't understand please say and I will try to explain it better.