What is the right way to create an object oriented PHP and MVC site?

I was wondering how to use PHP in an object oriented manner and with the MVC goo architectural template?

I tried a project at school to use MVC and make it object oriented, but I'm sure I'm wrong because when it came to deploying the website, I had so many problems that it was not useful. Obviously, now I'm trying to understand how, if I started everything around, I would go around doing this?

Will it make a big difference using a structure like Zend? If someone could point me to a good, structured, open source example, I would be very pleased because I just can't figure out the “right” way to do this.

Edit My main problem is not understanding MVC or OO separately, but using them together with PHP.

+3
source share
2 answers

I suggest the following:

  • Understand the basics of MVC by anti-aliasing through the Unconventional PHP MVC framework (not against code).
  • Check out MVC with a large name framework like Symfony to see the "best practices" in the game. Their documentation and code is worth the time.
  • Experiment.
+4
source

You should use some already created and tested framework. (They really have enough time and code) This is a good website for comparing various PHP frameworks.

, - , CodeIgniter Yii

0

Source: https://habr.com/ru/post/1788175/


All Articles