Jump to content

Recommended Posts

I have been learning php for just over a year now, and am getting pretty good at procedural coding. But now I can feel it is time to take it to the next step and be all about OOP. I have tried to learn some MVC, but at this stage I feel it is a bit too advanced for me, and am not quite ready for such a jump. So I was wondering what is a more basic design pattern, to just get started with OOP and getting used to classes.

 

So starting out, how is this usually done? Does each new page have its own class, e.g. products.php, and classes/products.php, and the product.php will just call various methods from the class? Or would there just be a library folder for different classes, and you include whichever class you need to use at a time? Should there be a general class or classes that are called on every page?

 

I guess I am asking what would be a good basic design pattern or structure to get strated with OOP?

Edited by 1internet

I found a book "PHP Advanced and Object-Oriented Programming" by Larry Ullman (Third Edition...though the Fourth Edition might be out now). This is the first book that OOP started making sense to me and he teaches you how to do a CMS using MVC (though he says MVC isn't technically a design pattern), though as he calls it a light form of MVC. I usually don't recommend books for I have come across some clunkers or they were way over my head, but not with this book. I'm still learning new things about OOP and still consider myself a newbie compared to others (specially ones who post here), though I find can look at OOP and understand what they are trying to do (In some cases what not to do. :happy-04: )

Edited by Strider64
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.