We are working on redesigning our web page which uses PHP. Right now most of the pages that I have designed follow a pretty simple format which gets complicated in the details but the overall flow is pretty simple. Each page has essentially 3 sections.
The first is a PHP switch statement that performs the appropriate “action” based on the POST method. Things such as add a record, delete a record, update a record.
Second, there is more PHP which querys the database and builds the HTML placing it in variables. A simple page may be stored in only one variable: $HTML, but normally there will be more so I can move things arround easily later.
Thirdly, is the actual HTML portion where all the $HTML variables created in section 2 are usually put into a table resulting in the final layout of the page.
What I would like to discuss, which may be beyond the scope of this board, is how to approach this in an OOP way using classes, objects, properties, and methods, and such? I understand the technical side of it well enough but I just can’t get my mind around how using objects will make things better and/or easier. Maybe someone could point me to some articles that might explain what makes OOP powerful.
Thanks,