Hello everybody.
I'm writing my own Content System in PHP5. I've written so far main
classes for handling DB connections, XML, XForms and Sessions.
But I've got problem with one thing - it's not even relative with
implementation - I'm looking for a smart solution
My present system works like this:
/?module=main&pa ge=intro
script includes and creates all classes instances - preprocess basic
actions - stats, privilages do some more things.
then it includes the '/main/intro.inc.php' file where I use all the
instances
but It's not and OO System when I use only 4 classes and a whole
system is procedural.
I was thinking about associating module 'main' with class 'main' and
page 'intro' with its method 'intro'.
The file 'main.inc.php' would be included and created new instance
main would be created - main inherits some properties and methods from
base class.
It would have delegate all the main classes to main eg.
$main->db->select();
$main->xml->addnode();
How do You find my solution?
Maybe You have some tips, hints?
I'd be thankful for any help
best regards
R
I'm writing my own Content System in PHP5. I've written so far main
classes for handling DB connections, XML, XForms and Sessions.
But I've got problem with one thing - it's not even relative with
implementation - I'm looking for a smart solution
My present system works like this:
/?module=main&pa ge=intro
script includes and creates all classes instances - preprocess basic
actions - stats, privilages do some more things.
then it includes the '/main/intro.inc.php' file where I use all the
instances
but It's not and OO System when I use only 4 classes and a whole
system is procedural.
I was thinking about associating module 'main' with class 'main' and
page 'intro' with its method 'intro'.
The file 'main.inc.php' would be included and created new instance
main would be created - main inherits some properties and methods from
base class.
It would have delegate all the main classes to main eg.
$main->db->select();
$main->xml->addnode();
How do You find my solution?
Maybe You have some tips, hints?
I'd be thankful for any help
best regards
R
Comment