Added: 11 months ago
From: phpacademy
Views: 10,170
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (67)

Sign In or Sign Up now to post a comment!
  • This video remembers me of my days learning Java language XD

  • Hello, this is a very interesting part of php, could you make more tutorials abou this?

    zipron

  • This man is a genius. I have read a lot about OOP. But Alex made it too easy for me.

    Alex please kindly make more videos on OOP. I will surely donate. I almost never forget anything I learn from Alex. It just sticks!!

  • IN the second part (where you make a method), I assume you could change the variable to

    private $gender = 'Male';

    and it would still work for the method when you call "$this->gender" because that method is part of the same class?

  • That was fantastic keep them coming... Hope you get rewarded in some way! Many thanks

  • I'm eating. I'm male.

  • Hey, I really liked your video; I'm not trying to be a prick but I just thought I'd like you know that it's not called Object OrientATed Programming; its actually Object Oriented Programming; you are mispronouncing the word Orientated in the video

  • I do tons of work with PHP and big applications but have had a need to use Classes. It seems more like an organizational thing.

  • thenewboston sent me here .... Subbed !!

  • I don't really see a use to OOP... Can you provide some *real world* examples? Thanks.

  • I actually love Oop and classes etc. Very cool

  • pubic is replaced by var.

  • yes, I don't get the point of OOP either. But, always good knowledge. :-)

  • hello Sir how r u.

    Where is the other parts of this tutorial

    Please Please Please Please Teach us with DETAIL of OOP

  • @deemipk More to come soon...

  • @phpacademy your comment was left 3 months ago ... how soon is soon? ... i do realize and appreciate that you do these on your own time and give them out for free.... thank you .. but how soon can we expect more on classes/oop please?

  • Whats the difference between classes and functions? Is there a reason classes (may) are better?

  • @CommentBBScript You can create many instances of the same class, however, the properties and methods for each declaration will be unique to the variable you assign the instance to. Hopefully this makes sense? Obviously, with a function you can't do this. This is the overall point of OOP.

  • I love your videos but i would never kill you if you could make them quicker. You should maybe use a different structure so you could free up some time in your videos. Here is what I mean:

    On the first video you should say what basics tutorials' information will be needed in the actual project/tutorial series.

    Then you should not explain what are you doing just say 'this is further explained in video XYZ.'

    --

    If this is a bad idea just ignore it anyway...

    greetings - from me

  • Object "ORIENTED", not "orientated"... lol. still... much love and props and thanks to you, sir!

  • @xninjax420 Lol... This guy always makes a mistake, sometimes it takes half a video to correct it...

  • I learned this while coming php with flash :)

  • Wouldn't public be classed as an instance/object ?

  • Comment removed

  • Comment removed

  • Thanks for the tutorial, it is easy to understand :) it's a little bit different than OOP in Java, but I'll get used to it! waiting for more tutorials!

  • So when your using $human->gender, it's kind of like get information from an xml document using php, like youtube api for example. Nice tutorials, keep up the good work. This seems interesting.

  • thanks m8 ur tutorials are great

  • Disculpa que te hable en español , pero siempre puedes usar traductor google, bueno te digo que nose por que usar CLASS para adentrar FUNCTIONES , si podemos dejar las FUNCTIONES sueltas sin ningun class , no le veo mucha logica aparte que lo de PUBLIC es una ventaja ya que no incluye dentro del parentisis function ($gender){

    echo $gender

    }

    bueno si me dicen la idea la entendere por lo que veo muy absurdo esto.

  • Comment removed

  • oop easy...do tutorial about deisgn pattern instead

  • Hooray this is what I've been waiting for! Just to let you know you taught me everything I know about PHP and now you're taking me from complete newbie to advanced! KEEP IT UP!!!!

  • finally!!.... oh wait do i going to have to buy the rest of it

  • finally!!

  • finally 

  • Object Oriented. Not "Object OrientATEd!"

  • Orientated or ORIENTED?, i think its the second one m8

  • can you after you have done a few more videos on OOP do a demonstration of how it could be used in action? I'm not sure what you could build as a demonstration but i'm sure you get my point. Also, can you do some videos on securing you're PHP scripts and methods help prevent hacking?

  • OOP is a great way to reuse code and add to it. Good video.

  • This is great, thanks! :)

  • BTW Sorry for spamming comments, but OOP is quite a big topic and I was bored and maybe the man behind phpacademy isn't bored enough to explain it all in comments.

  • While I've gotten pretty good at php... I still have an issue grasping how to use OOP in PHP within an everyday kinda thing... I can't wait to see it.

  • Extremely like Java, which is good because I've been doing a LOT of Java lately.

    :D

  • No 1911 button :/

  • What I don't get is why you can't just use functions and variables without classes -_- like the exact same thing to me. Maybe OOP is better for very advanced stuff?

  • @kleinespelvids OOP is basically used to create objects. So you could have like, 3 people, every single one with Age, Gender, and loads of other stuff (I'm not the most creative guy sorry xD). So you could have multiple of those without the need of making multiple arrays for each person, you could just create one array storing multiple Human's.

  • @katt157 Can't you use associative arrays for that? I'm kind of a noob for the moment, sorry 'bout that :/

  • @kleinespelvids Yes you can! But now you have just created these awesome arrays for no re-use. Unless you copy and paste which is disgusting. So if you used a class you could extend onto those objects. Using a "human" isn't a too good of a example, and OOP is best used in games and applications. But let's say you made a game in C#, and you wanted to make weapons for the player, you first make a class called "Items" and then a class called "Holdable's" which extends items (as it is a item.)

  • @kleinespelvids and you further from holdables make "weapon" which extends holdable, because it's a Holdable-item. Do you see how it goes on? This is why OOP is such a important thing to grasp. You will most likely go from PHP to C# if you want to try and make games later on (or java) where these are super important. But this is why classes and inheritance is so important when it comes to programing. And you really should learn it even if you'll never use it, if just to understand other's code.

  • @kleinespelvids Also, Arrays can contain methods (functions inside classes are called methods). So you can have one class "HumanHandler"(terrible naming ftw) and then human extends HumanHandler, so what that means is you give "Human" the variables and then every method in the "HumanHandler" is available in "Human", so that way you can follow the SRP, "Human" contains the variables and it extends "HumanHandler" so it can use functions such as "$Human->Name($name);" which you put in "HumanHandler"

  • @katt157 Oops not arrays, CLASSES. Stupid me xD

  • @katt157 Ok, thanks! I'd actually like to get into C but I don't know where to start between all the Cs: C, C++, C# ... what the hell is this all about? I know that C++ supports OOP, and is in some way better than C.

  • @kleinespelvids C++ is an upgrade from C. C# is a "C-Like Object Oriented Language" that's why it was originally going to be named "Cool". I'd recommend starting with C#, but remember, C# is .Net and Windows Only.

  • @kleinespelvids Now what he most likely will get into is the SRP (single responsibility principle) which is basically that one class should only have one responsibility. So, one class to contain the state of a "Human" (Like how much his health it, what his gender is at that time, his age right now) and you'll use other classes to modify that data. It's quite complicated to stay within the SRP sometimes, but you got to remember, it's just a principle, it's not a rule. It CAN do it the other way.

  • @kleinespelvids So the SRP is just to make your classes more usable in different circumstances.

  • @katt157 Ok, so it's basically just about organisation and better usuability of the code?

    Does OOP permit to do things you can't do some other way?

  • @kleinespelvids It's all about giving your code re-usability (making words on the fly FTW), to be able to just say :

    Ok so I'm going to use a type of posting here (like posting a comment), so I'll use my "Comment class" which extends (some class like post or message...) which extends....... and so on.

  • @kleinespelvids I really don't have any good examples on how it's useful in PHP, but I bet phpacademy has a great way of explaining how :)

  • Very good video. I've used OOP in C# and I can see the minor differences now.

  • Nice video. I've not used OO PHP before and it's something I'm going to be moving onto in the near future so this vid was good to clear up a few basics :)

  • @tctctc91 Excellent, look forward to more in the very near future.

  • do more about oop.

    it's a good subject! thanks.

  • @waitingfordoom I will be doing :)

  • Nice video, but its object oriented programming. Not orientated ;)

  • @JaxDragon1 As long as people know what he means right? ;)

  • First?

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more