Answer the question
In order to leave comments, you need to log in
Are the class types correct?
Guys, hello. I have a couple of questions.
1. Now, for the purpose of training, I am transferring my site (online store) to the oop style. I want to learn how to code in a new way. I decided to replace parts of the site gradually, pulling out the object and getting rid of the procedural code. Now I decide what objects will be. And that's what happened, right?
-Class "User" (methods: registration, authorization and management)
-Class "Product" (methods: loading, editing / deleting, other methods)
-Class "Controller" (methods: registering get variables, generating output based on output data)
-Class "Viewer" (view). Combines layout and objects for output by the controller.
2) Question. How to split one class into multiple files? I don't like it when a giant code is on one sheet, I'm used to splitting it into files. For example, one large method in one, the other in another, logical identical and small methods to combine. Apparently this is a normal class extension extend?
Answer the question
In order to leave comments, you need to log in
Translating an old case is no fun. I advise you to learn php fremvork.
For example codeigniter, cakephp.
And write your store on them from scratch.
It will be much more interesting in terms of learning, and so you will immediately learn the right things.
Now, for the purpose of training, I am transferring my site (online store) to the oop style. I want to learn how to code in a new way.Learn frameworks.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question