Can you please let me know how I Can create a very simple OOP MVC app in PHP to get some user data from a form like this
<form>
First Name:<br>
<input type="text" name="firstname">
<br>
Last Name:<br>
<input type="text" name="lastname">
<br><br>
<input type="submit" value="Submit">
</form>
and echo it out like
Your Name Full Name is XXXX,XXXXXX.
I have a file structure like
and in init.php
spl_autoload_register(function($class){
require_once 'controllers/'.$class.'.php';
require_once 'views/'.$class.'.php';
require_once 'models/'.$class.'.php';
});
Visitor = new Visitor();
now lets say if I create a m_visitor.php
including Visitor()
class in Model, how I can create associated class(es) or File(s) in Controller and View? and how I can sync them to get and set data from the Model to View and Controller?
This would be a great help to me to really understand how to deal with OOP - MVC structure in PHP. Thanks