How to implement the MVC standard in PHP

2

I'm a novice programmer and I'm having a hard time putting together my MVC framework. When I say structure I mean how to develop a model.php a view.php and a controller.php, in short what code to develop to connect them, make them interact with each other.

I already know what Model , View and Controller do, but want to know what to put into them in terms of code. What is the minimum that needs to be done to implement the MVC standard?

    
asked by anonymous 12.05.2015 / 17:25

1 answer

3

Wiki about the mvc tag might be a good starting point.

The MVC is a theoretical model, a design standard. There is this SitePoint link that can serve as a tutorial for your case in PHP . It's a bit extensive, so I do not know if it's worth posting a whole answer on that.

To improve your knowledge, I think it's also worth going for a better solution in a Framework, like CodeIgniter . Standards and good practices already exist in the Framework and this in particular requires you to write several manual steps.

Another great framework is Laravel .

Both have several questions answered here in SOpt.

On its difficulty in developing solutions, the way is to study, make the examples, learn a three Frameworks, point out the differences on how they solve the problems, and ask here. Bring your questions in a more specific way, putting code ready and asking for more code. There is not much secret.

    
12.05.2015 / 17:34