Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Adam Ridgley
12,255 PointsHelp with OOP PHP
Hi all,
I'm looking into creating an OOP application with PHP but I'm not sure how it all works. I've checked out the OOP basics videos in the library but they don't really show how you use classes and objects to create an application.
I'm only used to using functions like in the shirts4mike project, does anyone have any advice or examples of how I can use OOP to create applications?
Thanks, Adam
1 Answer
Andrew Shook
31,709 PointsAdam, Brian's comment above is right, OOP applications tend to be unique. However, if you can explain more about what your applications is suppose to do and it's different parts, I might be able to talk you through the basic structure and classes your app may need.
Adam Ridgley
12,255 PointsHi,
Well I've read through a few tutorials, I think i'm just struggling to understand why we use classes and objects when we can just use functions...
Anyway, I'm working on building a simple forum app and I want to use OOP but I'm not really sure where to begin. I've built the database structure but that's about it. If you could point me in the right direction of how I could use OOP to build an app like this that would be much appreciated.
Thanks
Brian van Vlymen
12,637 PointsBrian van Vlymen
12,637 Pointsthat all i know is This is usually a pretty open ended question. You should understand classes (objects are instantiated classes), abstract classes, interfaces, methods, properties,inheritance, multiple inheritance as well as why OOP is helpful as compared to procedural programming. http://net.tutsplus.com/tutorials/php/object-oriented-php-for-beginners/