5: Properties And Methods In OOP PHP | Object Oriented PHP Tutorial For Beginners | mmtuts

Поділитися
Вставка
  • Опубліковано 18 вер 2024

КОМЕНТАРІ • 137

  • @Shootaj
    @Shootaj 4 роки тому +26

    Daniel, WOW. I am currently studying a web developer program and we just started with OOP in PHP. Our teacher - who's really a consultant, is doing quite a "meh" job explaining things, I had such a difficult time understand what $this meant, the differences between private, protected & public, and what i.e $this->name = $name meant. You do such a phenomenal job explaining things, because you actually UNDERSTAND that some of us, as students, DON'T understand some basic things that you know by heart and take for granted.
    A sincere thank you for all the videos you do, I discovered you recently but I am already a huge fan.
    Cheers from Sweden!

    • @ApplicableProgramming
      @ApplicableProgramming 4 роки тому +3

      I noticed this as well, it is difficult (boring?) for people who have worked some time with one technology to explain it on a entry level. If you worked with something for many years, you do not even notice some things that might confuse beginners. I guess that is because consultant is focused on the technology and gets excited when he is using something new, challenging, and teacher is focused on students and gets excited when he see that Aha moment in students

  • @ps8112
    @ps8112 4 роки тому +20

    No one explain like this you have perfect teaching skills keep rocking....

  • @DriftyG
    @DriftyG 2 роки тому +6

    This is so underrated. Thanks for making this series.

  • @mahmoud.zayedd
    @mahmoud.zayedd 5 років тому +6

    You have fans from Egypt ❤

  • @cholo2605
    @cholo2605 Рік тому +3

    Thanks a lot Daniel, your courses are like goldmine

  • @clarkianturner
    @clarkianturner 5 років тому +5

    hey thank you for your videos im taking a web dev class in college online and these are a life saver!!

  • @AndresMontbrun
    @AndresMontbrun 4 роки тому +3

    Daniel, I am learning much easier with your explanations and your pace. you are a really good teacher. I am learning Laravel but had to go back to basics. and your course is great. regards from Caracas.

  • @blackflypress2336
    @blackflypress2336 3 роки тому +3

    best php oop breakdown on youtube.

  • @vanhelsingx69x
    @vanhelsingx69x Рік тому +2

    Best tutorials and playlist, I'm understanding classes for the first time... and I thought it's so hard, but it's actually easyear than I tought

  • @joselorenzo4790
    @joselorenzo4790 5 років тому +16

    Congratutlations for being such a great teacher

  • @francoisbourvil8733
    @francoisbourvil8733 5 років тому +2

    One of the clearest and simplest explanation I've seen !!

  • @Mr_lifecoder
    @Mr_lifecoder Рік тому

    your explanation makes object oriented programming easier to understand. thanks a lot Mr Daniel

  • @user-mo3cw6go7c
    @user-mo3cw6go7c 5 років тому +2

    the clearest and simplest explanation I've seen !!

  • @Lelouch690
    @Lelouch690 7 місяців тому +1

    I wish I had a professor like u teaching skill 10 on 10 🙏

  • @lawrencemichael5571
    @lawrencemichael5571 4 роки тому

    Probably the best PHP teacher on UA-cam!

  • @HeroCodeDev
    @HeroCodeDev 3 роки тому +2

    Your tutorial makes me get more interested in Php

  • @Creativejonc
    @Creativejonc Рік тому

    One of the best explanation that I received about Class in PHP. Thanks !

  • @sonovoxx
    @sonovoxx 5 років тому +12

    6:18 The 'dash' on its own is a hyphen!

    • @Dani_Krossing
      @Dani_Krossing  5 років тому +6

      Funny, I was thinking hyphen but it didn't sound right in my head. I'll remember it for next time :)

  • @callmekaymusic
    @callmekaymusic 5 років тому +4

    binge watching this series like crazy

  • @brad3201
    @brad3201 3 роки тому

    To clear up any confusion at 6:11, I think he meant to say "this specific object" (meaning an instance of the class) when talking about the "this" keyword. Really enjoying this series so far, Dani. Helping me a lot in getting ready for my internship that I have this summer!
    Edit: I think you explained it better later on in the video. Just wanted to make a comment because I know when I was first learning about classes and object while learning C++, I struggled to understand the correlation and how they worked together.

    • @danielmadison4451
      @danielmadison4451 Рік тому

      Same. Many years ago when moving from "C" to "C++" I wrestled for a year or two with Objects vs Classes, not realizing I was not understanding them. Then add "static" to the class properties, and nothing seemed to make sense. One day on a long walk it all became clear. The most confusing was that you didn't even have to instantiate an object to use its static properties and methods.

  • @niarastikatika2904
    @niarastikatika2904 4 роки тому

    crystal clear about oop. you are the best teacher

  • @johnlee5941
    @johnlee5941 3 роки тому

    Dani, you are the best teacher so far I have been seen ever. Explain everything patiently, thank you so much. :)

  • @samanthadiep
    @samanthadiep Рік тому

    You honestly don't get enough credit ! You're the best teacher 💪

  • @richardwilkins5241
    @richardwilkins5241 2 роки тому +1

    Your lessons have helped me immensely!

  • @stormybear4986
    @stormybear4986 Рік тому +2

    Hi Dani! this keystroke "-" is often called a dash, though the proper name for it is hyphen. but if you say dash, people will understand that you mean the hyphen.

  • @AnimalChannelTube
    @AnimalChannelTube 3 роки тому

    Great teacher good explain

  • @westfield90
    @westfield90 4 роки тому

    Thank you. One of the best videos I’ve seen. Never could wrap my head around this.

  • @MB-zj3er
    @MB-zj3er 2 роки тому

    The "dash" is a hyphen. Great classes, thank you!

  • @Ryangosden
    @Ryangosden 4 роки тому

    Extremely clear tutorials. Many thanks

  • @rbconcepcion
    @rbconcepcion 5 років тому

    Please don’t get tired uploading a very useful video tutorial

  • @Traymer7
    @Traymer7 5 років тому +2

    Wonderful tutorials, easily described and I loved it although I know the subject, wish I have found your tutorials back on the college :)

    • @nsubugagabby5489
      @nsubugagabby5489 2 роки тому

      you are so good a teacher . explain very well . actually u make any person ready to learn learn .

  • @ultrapvcromania1871
    @ultrapvcromania1871 3 роки тому

    you are a great teacher! Thanks!!!!

  • @tamisweitzer275
    @tamisweitzer275 2 роки тому +2

    For those who missed it, the "include" statement starts at 9:50.

  • @creationduwal
    @creationduwal 4 роки тому

    I love it when he does Classes!!! and do a sit up

  • @anismaiz85
    @anismaiz85 4 роки тому +1

    You remind me of Mr beast for some reason LOL, Great tutorial Mr daniel

  • @orangecode1902
    @orangecode1902 5 років тому +4

    sir kindly make a tutorial on pagination in php? thankyou

    • @slapmyfunkybass
      @slapmyfunkybass 5 років тому

      Orange Code
      Rough example
      if(isset($_GET['start_row']) {
      $start_row = $_GET['start_row']) {
      } else {
      $start_row = 0
      }
      mysql = select from table name limit 10 offset $start_row
      get data and populate
      Add two buttons, prev & next, querystring
      start_row=$start_row-10
      start_row=$start_row+10

  • @freddyzcount90
    @freddyzcount90 5 років тому

    at 7:13 it would be a good idea to check if the $name parameter is of type string OR use type hinting, since any value can be passed in. we would not want the name property to be able to contain integers

    • @Dani_Krossing
      @Dani_Krossing  5 років тому

      You are absolutely right :) type declaration is very useful and should be standard when creating functions/methods in applications.
      Just to explain why I didn't though...
      It is for the same reason I leave out talking about things like "namespaces", that I don't talk about type declaration. Because I know that a lot of people who are new to OOP (or PHP in general), are already overwhelmed with me just talking about properties and methods. So while technically correct, I delay some info to make sure that people don't get lost in all the new knowledge.
      Some might argue that in order to make more complete lessons I shouldn't neglect info like that, and I instead should teach it all comprehensively from start, but I know that there already exist lots of courses on this platform that does that, and those videos are more suited towards people who are faster learners or already have prior knowledge. There does however not exist many tutorials for people (like me) who need to take things one step at a time, which is the type of audience my channel primarily attracts.
      But you are absolutely right about type declaration :)

  • @geoafrikana
    @geoafrikana Рік тому +1

    The "Dash and Arrow" operator should be called a Darrow operator. After all, Python programmers refer to the double underscore as dunder.

  • @bakhadirtureev1215
    @bakhadirtureev1215 3 роки тому

    Cool explanation!

  • @juniorpirela6885
    @juniorpirela6885 4 роки тому

    I really like so much this tutorial, thanks Daniel

  • @ademineshat
    @ademineshat 5 років тому

    Hi
    Nice to see you again :)
    I was just wondering why you instantiated the object two times, we could just say:
    $person = new Person();

    $person->setName("Daniel");
    echo $person->name;
    $person->setName("Sam");
    echo $person->name;
    $person->setName("Unknown");
    echo $person->name;
    Anyway, thanks for your great tutorials !
    Best regards

    • @Dani_Krossing
      @Dani_Krossing  5 років тому +5

      In my video I created 2 objects by instantiating the class twice. In your code you created 1 object and kept replacing the value :) that's the difference.

  • @ChandraTech52
    @ChandraTech52 5 років тому +1

    Thank you so much, please make a project using PHP oops.

  • @Izkawi33
    @Izkawi33 2 роки тому

    thank you Mr Daniel I really enjoyed your explanation I understand from your lessons you have a good way to explain thanks alot but do you have applications on your channel for php oop??

  • @KM-sf6zy
    @KM-sf6zy 4 роки тому

    now I get it clear tnx alot

  • @Mizpress
    @Mizpress 5 років тому

    Hi, it’s Miz here. Nice tutorial. I am wondering which screen recording software are you using. What editing software you use? These info will help me a lot as I do make tuts also.

  • @linnywinn1841
    @linnywinn1841 2 роки тому

    Hello sir Daniel. I'm new in php and I love to watch your tutorials from the start. I have this confusion that where is the second line of the code was based, which folder?

  • @Stoney_Eagle
    @Stoney_Eagle 5 років тому +1

    -> small arrow (or just arrow) , => big arrow 😉

  • @AxxionMarketPlace-iu6ri
    @AxxionMarketPlace-iu6ri Рік тому

    Thank you

  • @diato2993
    @diato2993 3 роки тому

    always thanks!

  • @localLyricsPh
    @localLyricsPh 2 роки тому

    thank you! it helps alot in this pandemic, still learning without going to school :)

  • @newprogrammer1811
    @newprogrammer1811 5 років тому

    you deserve more SUBSCRIBERS

  • @Happystoreup
    @Happystoreup 4 роки тому

    Thank you Daniel!

  • @rbconcepcion
    @rbconcepcion 5 років тому

    Great tutorial. Nice job sir, its a big help for me

  • @sunnyshingala8791
    @sunnyshingala8791 4 роки тому

    Vey nice Daniel. Such a nice video Thanks a lot mate!

  • @annidariam7031
    @annidariam7031 4 роки тому

    Thank you very much for these video. I am new to php oop. I see you are instantiating obects into the index.php which I have not seen before. is this another way to do so? I am getting confused!

  • @aaronargottelopez3488
    @aaronargottelopez3488 3 роки тому

    Thanks

  • @OPGAMER.
    @OPGAMER. 4 роки тому +1

    6:21 Hey Dani!! I am New to Your Channel! Have Already Subscribed! " - " it is known as dash but it's real name is hyphen!!

    • @icl-jp8qd
      @icl-jp8qd 3 роки тому +1

      Im romanian living in Spain, and for the simplicity we call it "minus" :))

  • @deanclancy6448
    @deanclancy6448 4 роки тому

    Thanks. Great tutorials bruh!!

  • @thefin4lb0ss
    @thefin4lb0ss 4 роки тому

    great tutorial like always man

  • @pragneshkatkar31
    @pragneshkatkar31 5 років тому

    Can you please discuss about routing and navigation?

  • @ecosunflower1892
    @ecosunflower1892 4 роки тому

    I think I´m stupid, I´m kind of starring at you and not at the class content. :P You look good tho. I think I´m transpassing now. LOL

  • @JKW3973
    @JKW3973 4 роки тому

    @mmtuts the proper name of the dash is 'dart'

  • @chukwumaeberendu9585
    @chukwumaeberendu9585 3 роки тому +1

    great teaching but i cant seem to get the method part

  • @philip9677
    @philip9677 4 роки тому

    Hello Dani can you put this in a playlist, as you did for the other php course

    • @Dani_Krossing
      @Dani_Krossing  4 роки тому

      I already have them all in a playlist 😉

  • @navjotsingh2251
    @navjotsingh2251 4 роки тому +1

    6:20 it is called a dash, but the correct word is hyphen haha.

    • @tanjimashraf803
      @tanjimashraf803 4 роки тому

      Thank you brother. I was really wishing to find the correct name of that. Thanks again.

  • @daniel71626
    @daniel71626 5 років тому +2

    This is probably not the best video to start with. I totally new to PHP. But good instructor.

  • @user-hg4po3wc1y
    @user-hg4po3wc1y 4 роки тому +3

    So I found this with every tutorial teaching properties and methods. Really confusing and even mmtuts does it . So, lets look at this piece of code:
    public function setName($name){
    $this->name = $name;
    }
    A beginner will have a rough time understanding the difference between name and $name so my advice is don't even use it as an example it's futhile to do it. I mean you dont even have to use name as a property you can use person, human or any other word.
    For example : $this->human = $name; will return the same thing as $this->name = $name;
    So imagine an object as a bubble, inside the bubble you got properties describing the bubble.
    That being said name is never related to $name, it is only a property that will take different values based on what argument you call the function setName with.

  • @marnelarculan5506
    @marnelarculan5506 3 роки тому

    New subs

  • @blockanese3225
    @blockanese3225 5 років тому

    you told us the program you're using but you didn't tell us what kind of computer that was! lol jk, love the videos man thanks a bunch.

  • @kuldimanas
    @kuldimanas 5 років тому +11

    Damn you Daniel distracting me with your hip and belly shakes. Can't concentrate on the subject.
    Great tutorial as always!

  • @francischishimbe2058
    @francischishimbe2058 2 місяці тому

    Daniel I made websites because of you

  • @Born2DoubleUp
    @Born2DoubleUp 2 роки тому

    im here 🤓

  • @mangarific1
    @mangarific1 5 років тому

    Please make a swoole tutorial one day 😊

  • @peach5402
    @peach5402 5 років тому

    atom is nice, personnaly i use vscode

  • @diato2993
    @diato2993 3 роки тому

    I just wonder why did you use include function in this video because previous from previous video I didn't recognize anything going wrong without it

  • @timo_b3
    @timo_b3 3 роки тому

    You are epic

  • @rembrandt702
    @rembrandt702 3 роки тому

    You can call "->" an arrow.

  • @bhabanishankardash1443
    @bhabanishankardash1443 5 років тому

    Hi mmtuts, I have watched your nice video more than 10 times above. Tried to learn more and more to understand. It's clear. But your solution doesn't works when am trying to getting access from an another .php page. I mean to say, i have now 3 pages (index.php, master.php & class.inc.php). Ok. Now i have a Class (as per your video) inside the 'class.inc.php'. So, first I have set the Property:Value in-side my index.php. It's good and also echo out. Then after when the index.php redirected to my 'master.php' page by clicked on a Button, i can't able to get the previous set value of the property in the 'master.php'. I have set the property as 'public'. And also done (include_once "./includes/_viewClass.inc.php";) in each of my index & master.php pages. My requirement is to access the Property-value in the master.php, which is already set by in the previous index.php. Can it possible. Any comment and solution is highly appreciated.

    • @BlauDroid
      @BlauDroid 4 роки тому

      You can't set variables in one page and call them in another one. You need to use a database with that.

  • @rafaelvon5131
    @rafaelvon5131 4 роки тому

    Thanks! Mr. Beast 😂

  • @howuseehim
    @howuseehim Рік тому

    Bro learning php from Elon is the best that could've happened to me

  • @iamtafara
    @iamtafara 5 років тому +2

    where is 3 and 4

    • @Dani_Krossing
      @Dani_Krossing  5 років тому

      In this playlist. They are older videos but still valid.

    • @kuldimanas
      @kuldimanas 5 років тому

      here you go
      ua-cam.com/play/PL0eyrZgxdwhypQiZnYXM7z7-OTkcMgGPh.html

  • @pieterjanplessers5968
    @pieterjanplessers5968 5 років тому +1

    It's called a hyphen sir!

  • @jeesambo
    @jeesambo 2 роки тому

    Please is there a more efficient way to create a php files (I don't want to create a php file for each page) is there a way to do it dynamically.

    • @Dani_Krossing
      @Dani_Krossing  2 роки тому

      You don’t make your websites pages dynamic by creating new pages each time. You instead make a base page, and then change its content dynamically based on who is viewing the page.

  • @AndreaDavidEdelman
    @AndreaDavidEdelman 3 роки тому

    I don't think you mentioned classed in episode 4, it was variables and constants

  • @mtaakwamtaa3195
    @mtaakwamtaa3195 5 років тому +3

    If you don't understand this man it means that yo never understand any one ever!

  • @RonesonAngeloAbug
    @RonesonAngeloAbug 5 років тому

    nice gaming laptop! may I know the model and specs?

  • @mahattadinata2404
    @mahattadinata2404 5 років тому

    Do you think, it is worth to learn PHP 2019?

  • @merkyuk
    @merkyuk 3 роки тому

    Dash or Hyphen for '-'. So you're not wrong.

  • @asiahamdi822
    @asiahamdi822 3 роки тому

    i want source code but i have no e-account to take it from that site

  • @مولناب
    @مولناب 3 роки тому

    Why he didn't require or include the folder includes/person.inc.php before he used in the index.php

    • @fox_chess
      @fox_chess 3 роки тому

      same question here lot in php has changed

  • @BattleBoy
    @BattleBoy 5 років тому

    Can you make on torrent mobile client use

  • @adgahil
    @adgahil 4 роки тому

    $this -> name = $name.
    Still not making sense to me, I'm begginer. Would you be kind to explain again why you assigned a variable to a variable?

    • @oceceli2
      @oceceli2 4 роки тому

      "$this->name" refers to $name variable in the same class. And the "$name" refers to the $name variable in the function(or method).

    • @jolsky11
      @jolsky11 4 роки тому +1

      Maybe you understand, when you change it to:
      public function setName ($n) {
      $this -> name = $n
      }

  • @me89t
    @me89t 3 роки тому

    WHY WHY I COULDNOT OPEN THE LOCALHOST AS THE SAME LIKE YOU WITH DANIAL NAME ???????

  • @komplitrandom
    @komplitrandom 3 роки тому

    I cant find what I have done in the browser..😤😤 ... "This site cant be reached" 🥺🥺🥺

  • @Eminence43rd
    @Eminence43rd 3 роки тому

    How did you do that? You didn't include the class in index.php... Hoowww???

    • @kondekinoe9337
      @kondekinoe9337 3 роки тому

      That's what I was thinking and hope to find out 🤔🤔🤔🤔

  • @dvsmotions
    @dvsmotions 4 роки тому

    I have tried to understand OOP for the last 10 years and it just won't click with me. To me it just looks much more complicated way to do the same thing as procedural.

  • @DarkOverFlowOverflow
    @DarkOverFlowOverflow 5 років тому

    from www.w3schools.com/php/php_datatypes.asp got here for the obcjects because i didn't understand and now i understand advanced php at first day :p

  • @oscarmartinlive
    @oscarmartinlive 5 років тому

    Is this tutorial comprehensive?

  • @yungifez
    @yungifez 4 роки тому +1

    Why does this look like javascript

  • @bikramchettri9405
    @bikramchettri9405 5 років тому +1

    Part 3 & 4?

    • @Dani_Krossing
      @Dani_Krossing  5 років тому +1

      Doesn't need to be updated. So just watch the ones on this playlist.

    • @bikramchettri9405
      @bikramchettri9405 5 років тому

      @@Dani_Krossing Ok thanks. Will be a ride to learn PHP OOP. There was a time when i was a noob at frontend and could write php code but now it is exactly opposite.

    • @Dani_Krossing
      @Dani_Krossing  5 років тому +2

      I try to make my lessons as "noob" friendly as possible, so I hope you will get something out of these lessons. In my opinion there are no noobs when it comes to learning programming. It just means you have to learn it in a different way than others :)

    • @bikramchettri9405
      @bikramchettri9405 5 років тому

      @@Dani_Krossing Thanks man.