Answer the question
In order to leave comments, you need to log in
Understand how objects work in php with an example?
In general, I began to study OOP in php, but it is not entirely clear how it all looks in practice. And hello worlds don't help. So I started making a site with quotes - for the purpose of study.. It turned out to be functional, but it doesn’t work objectively..
There are category names in the database that I want to display in the sidebar as links, then display quotes on the pages - in the form of an html table - > quote + rating.
How to organize all this?
Answer the question
In order to leave comments, you need to log in
I advise you to take up the study of OOP frameworks. Then in practice you will already understand what's what and what is the charm of 3 OOP whales. In php, I really like the kohana framework. Or try to delve into the MVC design pattern yourself (Model - model. Responsible for working with the base. View - presentation .. class responsible for working with templates. Controller - controller). In a nutshell, these are 3 base classes from which most of your application grows.
Each table has its own model (Model) as a rule, and all these models will be inherited from the base model. View (view) - for working with html .. and the Controller is between models and views, and tells who to do what. Information on the Internet shaft on MVC.
In parallel, read books about design patterns.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question