Thanks for that.
Just one more question, i can get the controller to display a view, but how do i get a controller to process a $_POST coming from a view?
For instance, when you have a member, you can add, edit, view, delete.
So my initial plan was to have a controller named member with functions/methods;
function add
function view
function edit
function delete
each of these would create a new class object and call the appropriate function to execute the required action by passing the $_POST value to it as paramenters.
The challenge i had was when a view, say "add" is passed by the controller to the user to add a member, and is then submitted back to the controller, i believe the correct way would be to point to the controller in the form's action="controllername.php"
how do i set the controller to point the POST to the right function to add the member?
Given that if i have another POST for edit, and another POST for delete, the controller cannot know whether the POST being sent is for add, edit or delete.
This was also the additional challenge, if the admin controller has methods/functions "add_member" and then "add_equipment" that means $_POST cannot just be detected for one add/insert
That's why i had thought that it's easy to manage items in separate controllers such as
customer controller (with its add, edit, view delete functions/methods)
equipment controller (with its add, edit, view delete functions/methods)
and then have a way for admin to access both(and more), rather than have one admin controller with multiple add, edit, view, delete.
But the main question is, how to get $_POST from a view to be picked up by the desired function within the controller