How to implement the MVC standard in PHP

Asked

Viewed 652 times

3

I’m a novice programmer and I’m having a little trouble putting together my MVC structure. When I say structure I mean how to develop a model.php a view.php and a controller.php, finally what code to develop to connect them, make them interact with each other.

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

  • I would recommend Kohana as a starting point for teaching purposes.

1 answer

4


The Wiki on the tag mvc can be a good starting point.

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 little long, so I don’t know if it’s worth posting an entire answer about.

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

Another great framework is the Laravel.

Both have several questions answered here at Sopt.

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

  • 1

    Look, buddy the links you gave me helped me a little more What’s written on the wiki I already know! What else helped me was the other sitepoint link but the big problem is that I’m very beginner in English! but I understood a little! but not yet cleared my doubts completely sharpened more answers!

  • @xCoder What are your questions? It is very broad what you doubt. Could you edit your question and detail more?

  • yes, now I have further detailed the question!

  • 1

    About being in difficulties of logical reasoning, maybe it’s nice to study algorithm.

  • and what tools (programs), and content advises me to study ? to improve the ratiocio!

  • @xCoder I put a few more suggestions.

  • Ok, Gypsy now helped a lot I’ve heard very well about Laravel I found here now a great content about it I will study and develop something, but now I need to remedy my last doubt is about my difficulty in thinking to develop systems could answer ...

  • @xCoder Edited again. See if it fits you.

  • OK, you answered me yes! but for me to conclude that there is no content that can pass me to improve my reasoning ? because how am I going to develop a solution if I can’t reason ?

  • @xCoder The reasoning I have explained. It is in the last paragraph.

  • Okay, thanks is settled!

Show 6 more comments

Browser other questions tagged

You are not signed in. Login or sign up in order to post.