So, i'm building a system for educational purposes that will have several core fundamentals, most of the system is in place but there's one part I can't quite decide on when it comes to efficiency.
The system's idea is to be able to load modules and load augments (modules that fit into modules) in a literal file sense.
For example,
There is a directory called modules. You can in essence look at a module like an addon. However, I have one class that auto instantiates new modules into the system, the purpose is that each module is going to be a unique calculation that the user can either engage into an equation or disengage.
The layout is as such:
Modules/
Augments/
System/
In modules you may have something like this:
This all works fine, however the part i'm struggling with is a hierarchy part of the system....
I need to be able to call an element which may be required in EquationA.module.php, this element has data in a database. However it may be a child of some other element. The database looks like this:
So let's say the user has an equation in EquationA.module.php which takes
A-2 and multiplies it by B-1-1, that would be rather simple, however. I wish to display these Titles in a drop down fashion like so:
Is there anyway or any script that does this for me.
The modules and augmentations work perfectly and are very efficient for my first time at messing around with this depth of php, but this part has got me stumped.
The system's idea is to be able to load modules and load augments (modules that fit into modules) in a literal file sense.
For example,
There is a directory called modules. You can in essence look at a module like an addon. However, I have one class that auto instantiates new modules into the system, the purpose is that each module is going to be a unique calculation that the user can either engage into an equation or disengage.
The layout is as such:
Modules/
Augments/
System/
In modules you may have something like this:
Code:
Modules/
EquationA.module.php
EquationB.module.php
Augments/
EquationA.augment.php
EquationB.augment.php
System/
main.class.php
This all works fine, however the part i'm struggling with is a hierarchy part of the system....
I need to be able to call an element which may be required in EquationA.module.php, this element has data in a database. However it may be a child of some other element. The database looks like this:
Code:
ID Title Parent Magnitude
1 A NULL 150
2 A-1 1 5
3 A-2 1 24
4 A-1-1 3 12
So let's say the user has an equation in EquationA.module.php which takes
A-2 and multiplies it by B-1-1, that would be rather simple, however. I wish to display these Titles in a drop down fashion like so:
Code:
A
A-1
A-1-1
A-2
...
Is there anyway or any script that does this for me.
The modules and augmentations work perfectly and are very efficient for my first time at messing around with this depth of php, but this part has got me stumped.