Page 1 of 1

How to write code the OOP way

Posted: Tue May 28, 2019 1:57 am
by total212
As far as I know I redirect all requests to an entry point, something like a domain.com/index.php and then this gets redirected to a desired sub-page (if needed). I know the theory of the OOP quite well (like all the syntax elements and how they work) and I know that I would create one file per class (not a necessity but a good way to go).

As related to the above:
a) Where to I actually write code, I mean I create objects from classes, but where does it take place like in Linux filesystem (like I would have domain.com/process-pics.php and I would code there). Where does it go in the OOP way?
b) Do all conditional statements and loops go into objects (I mean, I write this code inside them). I know that I put $_POST and probably other superglobals in objects, so just wondering if my goal would be to have like 100% of the code inside of objects or if there would be cases where I just add it in a procedural way. Just have max amount of code inside of objects or not necessarily? If it is inside and outside (outside being procedural in the mix) what are the rules of this?

Thanks.

PS. And also thanks for the previous info. I know that more advanced things would be better but these are the things that I need to figure out still (self-edu, a year and a half so far).