Object Oriented PHP

  Рет қаралды 323,031

Derek Banas

Derek Banas

Күн бұрын

Пікірлер: 597
@derekbanas
@derekbanas 5 жыл бұрын
Learn in One Videos for Every Programming Language Subscribe to Bookmark them: bit.ly/2FWQZTx C++ : kzbin.info/www/bejne/iKbFXn2pn7Kbjbs Python : kzbin.info/www/bejne/hGXQdq18ec-kqqM Java : kzbin.info/www/bejne/pF7bcqSZd6iqqZY PHP : kzbin.info/www/bejne/bYWpYWOef65qbrs MySQL : kzbin.info/www/bejne/r4HYZ6SMasesq5Y JavaScript : kzbin.info/www/bejne/nJvYapyfbb6mfdU C# : kzbin.info/www/bejne/oprWmqqLj6-Lp7M HTML5 : kzbin.info/www/bejne/oXXce4FtprZ4iqM CSS3 : kzbin.info/www/bejne/eYbbeZKojLh8Z80 JQuery : kzbin.info/www/bejne/eIi7mJp4YrlkoLM TypeScript : kzbin.info/www/bejne/Y4G1kIunjJ59gLc ECMAScript : kzbin.info/www/bejne/gJLOoJxmfJ2feMk Swift : kzbin.info/www/bejne/mnzEoJ2Fj5KUsJo R : kzbin.info/www/bejne/qWSpoK2Mm8lqp5Y Haskell : kzbin.info/www/bejne/ZmPCeWaCn9aAqJo Handlebars : kzbin.info/www/bejne/annYcqGDa8dlmpo Bootstrap : kzbin.info/www/bejne/naKydqKLh5qFfsk Rust : kzbin.info/www/bejne/i2Kod5p5g7F3eJo Matlab : kzbin.info/www/bejne/hIS2hZ6hgLeUmKs Arduino : kzbin.info/www/bejne/h4DCe5-wZtajetk Crystal : kzbin.info/www/bejne/eqmpgWCNn9anqcU Emacs : kzbin.info/www/bejne/f5LKk6lvbJl6orM Clojure : kzbin.info/www/bejne/mZqqqnuhedqDd6c Shell : kzbin.info/www/bejne/nqjVn6CHqtKnhtk Perl : kzbin.info/www/bejne/jXbKmXyOqJ15bMU Perl6 : kzbin.info/www/bejne/omHdgaqenLyHna8 Elixir : kzbin.info/www/bejne/pnOxgJSsh9SBgpI D : kzbin.info/www/bejne/qKi9d4ekm56Verc Fortran : kzbin.info/www/bejne/lZCVhpp8g76anJo LaTeX : kzbin.info/www/bejne/jJnQnH-ohM9_qdk F# : kzbin.info/www/bejne/mWjIf3eAg5xobrc Kotlin : kzbin.info/www/bejne/fpDSeJxuqtp3pqM Erlang : kzbin.info/www/bejne/f3bLqJZoppatfZY Groovy : kzbin.info/www/bejne/eGqbm5Zuncmob8k Scala : kzbin.info/www/bejne/equppWOPoL-ibq8 Lua : kzbin.info/www/bejne/n37ElKuQhrKDjtU Ruby : kzbin.info/www/bejne/epvManSCeMyZpq8 Go : kzbin.info/www/bejne/eXechGeHj9qJaZI Objective C : kzbin.info/www/bejne/a5bWgqSQfq9rack Prolog : kzbin.info/www/bejne/iarOqYqme9yAfdU LISP : kzbin.info/www/bejne/r562ometfdekr7c Express : kzbin.info/www/bejne/rnWmfJaEd6umq6s Jade : kzbin.info/www/bejne/omakiZaOdrVnqJo Sass : kzbin.info/www/bejne/rauWnHiigcd4fqc
@VybeAndThrive
@VybeAndThrive 5 жыл бұрын
hi derek i just started learning php and mysq. i have question on php and mysql coding. can i email you the code to you could tell me what i did wrong. I don't know how to fix the error. much appreciated 🙏
@tomasbartninkas7957
@tomasbartninkas7957 6 жыл бұрын
11:00-11:03 best programmer quote of the year. I enjoy your videos though, best i could find on youtube for my tastes, hope you don't quit anytime soon. In general, great work!
@PhilSmulian
@PhilSmulian 8 жыл бұрын
You're the first tut video maker I've seen that doesn't take forever to spit the words out, or constantly digress with side-thoughts. You effortlessly compacted an enormous amount of info into this vid, in record time. Thanks Derek I now have an almost complete understanding of classes & objects!
@derekbanas
@derekbanas 8 жыл бұрын
+Phil Smulian Thank you for the compliment :) I do my best to not waste peoples time.
@programthis3805
@programthis3805 10 жыл бұрын
This is why i hate college... these two php videos would take months to learn in school and cost a $hit ton of $$$...
@derekbanas
@derekbanas 10 жыл бұрын
ProgramThis! Thank you :) I'm doing my best to make education available for free.
@crazybuzz100
@crazybuzz100 10 жыл бұрын
Derek Banas The world of education is slowly changing for the better... And it's all thanks to people like you and videos like these.
@sumsuddinmidday1090
@sumsuddinmidday1090 8 жыл бұрын
Your Videos are great.... Thank You! May God Bless You!
@pockettraveldiaries
@pockettraveldiaries 7 жыл бұрын
so true
@pockettraveldiaries
@pockettraveldiaries 7 жыл бұрын
+Derek Banas that is so noble task. We need more people like you in the world! Keep the good work going! :)
@arvilmena6203
@arvilmena6203 9 жыл бұрын
I came from the plain old procedural PHP programming and had been struggling to find a decent tut to make me understand OOP design and this is far the best tut i ever found on the internet. Thank you! Subscribed.
@derekbanas
@derekbanas 9 жыл бұрын
Zirius Ang Dakila Thank you :) I'm very happy that I could help
@arvilmena6203
@arvilmena6203 9 жыл бұрын
btw, if I may suggest, can you pursue this series by adding OOP PHP-MySQL tutorial video. I honestly want to know how would OOP design be considered once you will need to have the interaction with database. Should there be a class for all sql query? something like that maybe?
@davematthews414
@davematthews414 8 жыл бұрын
Fantastic! I absolutely love the way you present information and the speed of your videos! Please do NOT change! I understand that those who are not familiar with the terminology will find it difficult to follow, but once you have progressed beyond that stage it can get so tiring and time-consuming to wade through these basics in order to get the real information. Your videos are like a breath of fresh air. Thank you.
@derekbanas
@derekbanas 8 жыл бұрын
Thank you for all the nice compliments :) Don't worry I won't change.
@veetoutas
@veetoutas 6 жыл бұрын
Derek, not only Your tutorials are extremely efficient and professional, but i love the mood You are presenting it all with. Some kind of a funny sarcastic comedy type positive voice that makes it feel as if everything is easier than it seems and so it puts my mind in a way that it is fun to learn and makes me hungry for this knowledge. Thank You so much, i hope You are getting at least something out of these videos, because what You give us is priceless. Big fan and a learner from Lithuania! :)
@mmb811
@mmb811 10 жыл бұрын
Your tuts are to the point and does not waste time with all kinds of rubbish info or slow typing and you don't waste time. Your tut videos are AWESOME, keep up the GREAT work !.
@derekbanas
@derekbanas 10 жыл бұрын
mmb811 Thank you for the nice compliments :)
@nickmacdonald7
@nickmacdonald7 8 жыл бұрын
WHY WAS SPOT DESTROYED? RIP SPOT :'(
@derekbanas
@derekbanas 8 жыл бұрын
Poor Spot he died so young :(
@eflrioninc4638
@eflrioninc4638 5 жыл бұрын
T o T
@WebDevAnjali
@WebDevAnjali 5 жыл бұрын
loll
@zewtorious
@zewtorious 9 жыл бұрын
I can not stress enough how much this has helped. I am a long time PHP coder who has always had a mental block with classes OOC. This will help greatly in me writing more secure code, using less variables being passed in the URL.
@derekbanas
@derekbanas 9 жыл бұрын
+zewtorious I am very happy that it helped :)
@FrostyXVII
@FrostyXVII 6 жыл бұрын
Been with you since the first week. You are a savage my man Mr. Banas.
@randzgonzable
@randzgonzable 7 жыл бұрын
Hello Derek.. I just want to personally thank you for creating quality videos about programming and stuff that are relevant to it. This way we can learn from your videos without paying and going to school. Hopefully, we can pay it forward to many people in the future. Thank you very much! :)
@derekbanas
@derekbanas 7 жыл бұрын
Thank you for taking the time to tell me they help :) The goal is always to provide a free education for all
@randzgonzable
@randzgonzable 7 жыл бұрын
May God bless us all.
@turboromy
@turboromy 7 жыл бұрын
Watched this again for a review as I get deeper into Wordpress. All of the unsure things of php were already all explained here. Thanks for making such a compact and info-rich videos.
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) I'm very happy that it helped
@jonedue4260
@jonedue4260 6 жыл бұрын
Like any other PHP static variable, static properties may only be initialized using a literal or constant before PHP 5.6; expressions are not allowed. In PHP 5.6 and later, the same rules apply as const expressions: some limited expressions are possible, provided they can be evaluated at compile time.
@kristinehelms5381
@kristinehelms5381 9 жыл бұрын
The thing you do, starting with an visual and simple example of the subject, is what makes this video better than the others. Thank you :-)
@derekbanas
@derekbanas 9 жыл бұрын
+Kristine Helms Thank you very much for the compliment :)
@SJ-ci8oi
@SJ-ci8oi 9 жыл бұрын
Thank you so much for this! This is the best, most coherent and comprehensive tutorial on php classes I have been able to find! I finally understand so much more and see possibilities and flexibility where I was once confused. I will be watching more of your tutorials! Thank you!
@derekbanas
@derekbanas 9 жыл бұрын
+Sarah Elizabeth Thank you for the nice compliment :) I'm very happy that it helped.
@snorky500
@snorky500 7 жыл бұрын
I have been programming in php in a functional style, not OOP. This tutorial really filled in a lot of gaps that I did not understand before. Thank you!!!
@derekbanas
@derekbanas 7 жыл бұрын
You're very welcome :) I'm happy it helped
@cengologin
@cengologin 8 жыл бұрын
One of the best OOP tutorial I've seen, thanks a lot!
@derekbanas
@derekbanas 8 жыл бұрын
Thank you very much :)
@d13x001
@d13x001 7 жыл бұрын
I honestly feel that Derek has helped change the face of the internet. He is teaching and inspiring the developers of today to develop the internet for tomorrow. Bravo.
@derekbanas
@derekbanas 7 жыл бұрын
Thank you for the very nice compliment :) Wow, that was very nice. I hope that I have been able to help. I'm very lucky to be in the position to do this.
@MIO9_sh
@MIO9_sh 7 жыл бұрын
hmm.... I can't accept calling a static variable with object
@ramsesperez200
@ramsesperez200 5 жыл бұрын
I love this video because I already have knowledge of Classes in other programming language, and I just needed a summary of it in PHP. This makes it so easy to compare and translate from one to another. Awesome Video! Thank you!
@derekbanas
@derekbanas 5 жыл бұрын
Thank you very much :) I'm glad it helped
@TheAmbush9999
@TheAmbush9999 8 жыл бұрын
Just coming back to my original PHP tutorials I followed a while ago. Thanks Derek for making these videos! I'm now a Web developer and it all started from these videos. marcus
@derekbanas
@derekbanas 8 жыл бұрын
That's awesome!!! Congratulations on your job :)
@GohersWay
@GohersWay 6 жыл бұрын
Definition: An object is a software bundle of variables and related methods. Note : Before watching this videos I have wrote the following example hoping I am right. $somevariable = new SomeClass(); // probably the protected variables inside class called attributes? // and here $somevariable is // an object of SomeClass() echo $somevariable - > functionInsideSomeClass(); // functionInsideSomeClass(); have to return something to display
@narval6108
@narval6108 5 жыл бұрын
WOW that was a bunch of information in 26 minutes! You are good! I am a beginer so I will need to watch this a couple of times. Thanks for the tutorial, dude!
@derekbanas
@derekbanas 5 жыл бұрын
Thank you very much :) When I promise something in the title I do my best to meet it
@highway-sniper
@highway-sniper 8 жыл бұрын
You are awesome. I thought to subscribe in the middle of this video specifically but guess what I already have your channel subscription. Thank you for such a cool video. It's like easing out pain and putting me in a situation to know more PHP OOP.
@derekbanas
@derekbanas 8 жыл бұрын
Thank you for the nice compliment :) I'm very happy that it helped
@phonerenew
@phonerenew 4 жыл бұрын
Great video! This quick and generalized style of teaching is exactly what works for me. Now I just need one for Doctrine ORM and Symfony.
@derekbanas
@derekbanas 4 жыл бұрын
Happy I could help :) I'll see what I can do about the requests
@nykachuu
@nykachuu 8 жыл бұрын
with all the programming languages I've learned, I have never really understood how it works and where its needed, but now I do, thanks so much!
@derekbanas
@derekbanas 8 жыл бұрын
Thank you :) I'm very happy it helped
@Her_Viscera
@Her_Viscera 8 жыл бұрын
Great video, as a Web Developer I find theres a real lack of quality educational videos online. Keep it up!
@derekbanas
@derekbanas 8 жыл бұрын
Thank you for the compliment :) I do my best
@jdgamboa5201
@jdgamboa5201 8 жыл бұрын
This seems like a great video for someone who already has some knowledge about coding and not for beginners... but since I belong to the first group THANKS!!
@derekbanas
@derekbanas 8 жыл бұрын
You're welcome :) Yes it is for people that have experience in programming other languages.
@gilsonviana4936
@gilsonviana4936 8 жыл бұрын
That's what I call - fast paced tutorial. Derek your videos are the best.
@derekbanas
@derekbanas 8 жыл бұрын
Thank you very much :)
@MayurVirkar
@MayurVirkar 10 жыл бұрын
Irakli Khakhviashvili speed is fine. This is the best thing about Derek Banas . He keeps it fast so viewers wont get bored. And you always have a "Replay" Option. Dont want to be a jerk, but all i am saying is Speed is fine. Its perfect!
@solarek26
@solarek26 9 жыл бұрын
Very very useful tutorial. Someone who haven't know OOP yet should watch this to learn. It's pefect.
@derekbanas
@derekbanas 9 жыл бұрын
+Patryk Wojciechowski Thank you for the very nice compliment :)
@NeomeniaXXVI
@NeomeniaXXVI 9 жыл бұрын
Hi Derek, I'm glad to say you I'm learning a lot of programming just watching your videos. Thank you very much!
@apseh721
@apseh721 9 жыл бұрын
Hi Derek, I am absolute fan of yours and I think you have the most perfect & impressive voice for these tutorials. I follow your tutorials and just love your explanations. I would be most glad to see a tutorial on php exception handling with their actual implementation in websites.Now while there are many tutorials on that, one from you would be the best. I would particularly like to see how to implement / display an error page that is displayed every time an error occurs and display those errors keeping in mind whether it is running in the design or production mode. Thanks and I really hope you will consider to do this tutorial soon. Thank you.
@derekbanas
@derekbanas 9 жыл бұрын
+Ap Seh Thank you for the very nice compliment :) I hope to get back to PHP very soon.
@apseh721
@apseh721 9 жыл бұрын
Hi Derek, Thanks for the reply and looking forward to seeing you there soon !
@avhd187
@avhd187 7 жыл бұрын
Am I seeing something? Class constants use "const" and Classless constant use "define" but why?
@derekbanas
@derekbanas 7 жыл бұрын
PHP is weird
@Badprop7
@Badprop7 9 жыл бұрын
This is great for a procedural programmer like me that needs to work in a OOP environment. Thanks a million. This helped a lot.
@derekbanas
@derekbanas 9 жыл бұрын
Johan Potgieter You're very welcome :)
@FarryEntertainment
@FarryEntertainment 7 жыл бұрын
I still have no idea how this could be useful in like making a Webshop or a hotel room reserving website. What are the benefits of OO instead of just using SQL while loops etc?
@Kwisatsoundman
@Kwisatsoundman 6 жыл бұрын
The benefit is mainly that you can much better organize your code by dividing it into meaningful sections more closely related to the way the concepts they describe are organized in the real life. By writing your code this way, you can also avoid code duplication by interacting between those parts more efficently, thus increasing performance and letting you more easily maintain your application and add new functionnalities to it over time. For example, you could create a Customer class, from wich an object $customer is created each time you get a new customer, automatically assigning him a name, an age, a salary, etc. through the constructor method of this class, and incrementing the value of a static variable $totalNumberOfCustomers by one in this case, and decreasing it through the destructor method if the customer never came back after several years.... And you could create a mother class Room, and several daughter classes LittleRoom, AverageRoom and BigRoom that would each inherit commun properties from the Room class, but still defining each one different values for those. That kind of stuff...
@niccolamborghini
@niccolamborghini 4 жыл бұрын
Love the :-( in the destructor. Its sooo nice
@otubeify
@otubeify 7 жыл бұрын
Love it. Compact, concise and complete. Very refreshing and easy to follow.
@Reebox32
@Reebox32 8 жыл бұрын
Note: The oop tutorials are based in real objects with solid examples, the real life in programation is very abstract and most times you have to think strange way, is normal.
@programthis3805
@programthis3805 10 жыл бұрын
I love these one video series so much! this is a fantastic channel!
@derekbanas
@derekbanas 10 жыл бұрын
ProgramThis! Thank you :) Rails are coming next.
@bigmax1839
@bigmax1839 8 жыл бұрын
I love you! you always keep me way more advanced than my classes !
@derekbanas
@derekbanas 8 жыл бұрын
Thank you :) I'm very happy to be able to help
@mikopiko
@mikopiko 5 жыл бұрын
Instead of: function __set($attribute, $value) { switch ($attribute) { case type: $this->type = $value; break; case name: $this->name = $value; break; case age: $this->age = $value; break; default: echo $attribute . " not found "; } } you can do: function __set($attribute, $value) { $this->$attribute = $value; }
@LocPhamDac
@LocPhamDac 9 жыл бұрын
You briefly mentioned at the end of this video that you covered wordpress using PHP extensively but I'm unable to find those videos on your playlist. Can you refer to those specific ones? Thanks.
@derekbanas
@derekbanas 9 жыл бұрын
+Loc Pham I have a ton of Wordpress tutorials on this page www.newthinktank.com/videos/web-programming/wordpress-how-to/
@LocPhamDac
@LocPhamDac 9 жыл бұрын
+Derek Banas Thanks. I was searching through your youtube playlist.
@TomSkinner
@TomSkinner 7 жыл бұрын
For me this was a very good synopsis of PHP OOP. Thanks.
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) I'm glad you liked it
@GiuseppeTavella
@GiuseppeTavella 7 жыл бұрын
Hey Derek, thanks so much. You know a lot of things, what did you study? Did you have a career as a developer?
@derekbanas
@derekbanas 7 жыл бұрын
I'm happy to be able to help :) Yes I've been a programmer for 30 years. I've worked at Apple, in financial services, web development, etc. I currently mainly make shopping carts and mobile apps
@ryanschurton
@ryanschurton 9 жыл бұрын
Hey Derek great tutorial, I had a question regarding the __get and __set magic methods. Is it more desirable to use getter and setter magic methods or define your own custom getters and setters?
@derekbanas
@derekbanas 9 жыл бұрын
Ryan Schurton It depends only on if you must do any special checking on the data or not.
@dannyboy9613
@dannyboy9613 9 жыл бұрын
Also at 0:46 he say "He may have an ARRAY of ties, shirts, pants, and shoes." Well if he say an ARRAY as we thought the ARRAY as a variable ?
@princessgohar140
@princessgohar140 10 жыл бұрын
I am completely new to JAVA. Your videos are really amazing & BEST IN THE WORLD and they are helping me a lot. Thank you soooo much.
@derekbanas
@derekbanas 10 жыл бұрын
Princess Gohar Thank you for the nice compliment :) You're very welcome
@33mauriciom
@33mauriciom 10 жыл бұрын
I really like your videos, man ! I learnt lots of things in your videos instead of my college course in a short period of time ! Thank you very much for sharing your knowledge !
@derekbanas
@derekbanas 10 жыл бұрын
Mauricio Ferreira Thank you :) I'm very happy that I could help.
@TheSkogemann
@TheSkogemann 10 жыл бұрын
You did it again, sir! Excelent video! * Applause *
@derekbanas
@derekbanas 10 жыл бұрын
TheSkogemann Thank you :) I'm glad everyone seems to like these
@freightuk
@freightuk 9 жыл бұрын
Thanks, very good overview of what PHP provides for OOD, JIm
@derekbanas
@derekbanas 9 жыл бұрын
+freightuk Thank you :)
@alexandru2882
@alexandru2882 7 жыл бұрын
I would like to see videos that break down the concept of object programming, so that I could take in one concept at a time in small steps. The first part of this video is easy to understand. When it gets complicated, I can't grasp any of the concepts. It would help to go in depth on every concept, one at a time. Thank you.
@ilikeitnice
@ilikeitnice 8 жыл бұрын
Awesome video - Thank you for putting it together. I have one question, Something I'm not able to wrap my head around yet is the "this->name" thing. Could you expand on that a bit further? Kind Regards
@derekbanas
@derekbanas 8 жыл бұрын
+AlAndalus Thank you :) When you create a class you need a way of referring to the object. Since the class is made before the object you can't refer to it by name so you refer to it with the default this.
@AndresOrjuelaTheSpecial
@AndresOrjuelaTheSpecial 10 жыл бұрын
Hi Derek! Thanks for all your great tutorials. I was watching this one and following along in my computer. I ran into some differences and wonder what it could be due to. When I have a method in a class with a echo line and then I create the class and then call the method, I don't get the echo showing in my chrome web browser. I can see it is working as I can return something in the method and that will display, but any echo lines I put in the method do not display. Any thoughts why this would be? In your example you have the magic method __get echo "Asked for" . $name . ""; If I do this and call the get method it returns the name, but does not print the echo line (ex. Asked for sound).
@SomebodyOutTh3re
@SomebodyOutTh3re 6 жыл бұрын
Your videos are pure Gold
@derekbanas
@derekbanas 6 жыл бұрын
Thank you :) I try to do my best
@ArpadBelovai
@ArpadBelovai 10 жыл бұрын
It was really good again! I'm waiting the continuation with namespaces, EventListener or something :) But I have a question: Why do you use snake case instead of CamleCase? Is there any reason or habit? IMO the CamelCase more frequent in the PHP.
@derekbanas
@derekbanas 10 жыл бұрын
Árpád Belovai I'm not biased towards any naming conventions. Since I normally consult I use what ever the organization prefers.
@realchicagophill
@realchicagophill 8 жыл бұрын
I'm still struggling with one point. Why do we bother setting properties at the top of the class? I get it when they have a default value assigned but just declaring a property just doesn't make sense to me. If it has no value then it's just as easy to assign a variable inside the method. Can you shed some light on why this is done and why it's good practice? I've searched online for an answer but really haven't found a very good explanation.
@derekbanas
@derekbanas 8 жыл бұрын
+Phillip R Jorgensen (ChicagoPhil) We are modeling real world objects in our classes. Every object has attributes or properties in the real world. We are defining them here. Also we define capabilities or functions that represent those capabilities of a real world object.
@realchicagophill
@realchicagophill 8 жыл бұрын
+Derek Banas thank you for the quick reply. I understand that idea but I still don't understand the benefit. I'm a thick headed brain dead Irishman. I'm going to watch this video 20 or 30 more times and see if I'm just missing something. I've been playing with Codeigniter and the menu system I'm building has my brain hurting. If there is a clear benefit to defining properties at the top of my class instead of just when I'm going to use the variable. I basically don't use properties unless they have a default value like a table name or something.
@realchicagophill
@realchicagophill 8 жыл бұрын
+Derek Banas I'm getting it. can't believe I was missing this.
@MJ_on_YouTube
@MJ_on_YouTube 10 жыл бұрын
I love your vids! I love the fact that you pump out a $h!+ load of information in a short period of time.... Thank you soooooo much!
@derekbanas
@derekbanas 10 жыл бұрын
Matt Dixon Thank you :) I did my best to make original videos. I'm glad you like them.
@MJ_on_YouTube
@MJ_on_YouTube 10 жыл бұрын
Derek Banas I like you even more that you took the time to respond to me.... I am a new developer that came from a CAD/CAM background.... Crazy eh? Here is something I made as a CAD person, but only for fun..... scontent-a-iad.xx.fbcdn.net/hphotos-xap1/t31.0-8/1400593_10200845606214754_1716709710_o.jpg
@crazybuzz100
@crazybuzz100 10 жыл бұрын
Matt Dixon Nice!
@manav8289
@manav8289 9 жыл бұрын
Hey Derek, this helped me, thank you so much! :) One request though, could you please show abstract classes in action? And does every method and attribute in an abstract class need the keyword 'abstract' before it?
@angelinajolie3921
@angelinajolie3921 10 жыл бұрын
Another Amazing Tutorial By Derek Banas!
@derekbanas
@derekbanas 10 жыл бұрын
***** Thank you :) I promised it was coming.
@Maxformidable
@Maxformidable 8 жыл бұрын
He's a genius yer man Derek, brill vid, brill tutorial, well worth checking out the links, rewrite the code line by line and try to understand it. One of the best channels on youTube
@derekbanas
@derekbanas 8 жыл бұрын
Thank you for the nice compliment :)
@TheITWarrior
@TheITWarrior 9 жыл бұрын
Could you make a small video covering PHP Namespaces, anonymous functions, traits? Especially traits and namespaces are topics that I have struggled with.
@derekbanas
@derekbanas 9 жыл бұрын
+ITWarrior I'll see what I can do. Thank you for the request.
@dannyboy9613
@dannyboy9613 9 жыл бұрын
Please take a look at 0:39 - Now we have a basic CLASS Man. What thats gonna mean is man has all their attributes ... etc. When he say CLASS is that CLASS that we thought about ? you know like div id in html ? or CLASS like a FUNCTION ?
@derekbanas
@derekbanas 9 жыл бұрын
Danny Boy A class is used as a blueprint for creating objects. You make them by defining the attributes (variables) and capabilities (functions) a real world object would have.
@dannyboy9613
@dannyboy9613 9 жыл бұрын
Derek Banas yes sir Now I understand. But my ultimate question is about the function at wordpress. Which is there is so much certain function, that impossible for me to understand. I refer to this kind like this if ( defined('WP_USE_THEMES') its exist at template-loader.php. I mean is it any library to at least explain what function is telling about ? coz I cant find it at codex wordpress either. Thank you very much for your attention.
@MegaTeckguy
@MegaTeckguy 5 жыл бұрын
Thanks for this tutorial Derek! It was really useful as a quick review of php for work. Keep up the great work!
@derekbanas
@derekbanas 5 жыл бұрын
Thank you very much :) I'm happy I could help
@radekmojzis9829
@radekmojzis9829 8 жыл бұрын
wow, i literally learned php and mySQL in 2 hours :D (since i can program in C and C++ this was everything needed), thak you so much
@derekbanas
@derekbanas 8 жыл бұрын
I'm very happy that I could help :)
@MrBledi
@MrBledi 5 жыл бұрын
what a great roller coaster of oop tut. to follow this is!
@derekbanas
@derekbanas 5 жыл бұрын
Thank you very much :)
@Iminic1990
@Iminic1990 10 жыл бұрын
Nice summary of the basics of OOPHP. Next time: namespaces, auto-loading, package management, reflection classes? In stead of using a switch to detect whether a property exist, you could try using property_exists($this, $name) (php.net/manual/en/function.property-exists.php). This way, you would not need to change the switch statement every time you change/add/delete a property. Making your code more concise and maintainable.
@derekbanas
@derekbanas 10 жыл бұрын
Rotharius Thank you :) Yes I made a judgement call there on whether to use that method or switch. I probably should have shown both. Thank you for the input
@Iminic1990
@Iminic1990 10 жыл бұрын
I understand why you did it; to keep things simple for newcomers to OOPHP and not scare them off with all these new scary functions. Perhaps some inspiration for a more in-depth tutorial on OOPHP? ;) Anyway, thanks for the video.
@EnduranceT
@EnduranceT 8 жыл бұрын
Derek, coming from C# and JS, I feel like I already know PHP. I love PHP's logical function/method names... One of the things I hate about JS is the pop() push() shift() crap. I actually studied PHP 3 when I was like 12... Has there been a lot of change since? Its hard for me to remember.
@derekbanas
@derekbanas 8 жыл бұрын
I love PHP as well. Yes there have been quite a lot of changes. It is a constantly evolving language.
@Александр-е5ж2в
@Александр-е5ж2в 9 жыл бұрын
why did you tell something, without showing the way which will be usefulll for????
@russelldicken9930
@russelldicken9930 8 жыл бұрын
Very useful refresher. I'd like to see you cover Cakephp too.
@derekbanas
@derekbanas 8 жыл бұрын
+Russell Dicken Thank you :) It is on the list
@1scottish1
@1scottish1 9 жыл бұрын
This is a great explanation of OOP in any language! Great video. :)
@derekbanas
@derekbanas 9 жыл бұрын
Scott Allen Thank you :)
@salimkotadiya3023
@salimkotadiya3023 9 жыл бұрын
@Darek. After my first love. this is first time i have this feeling of love you for your video. I just pose video and came here to comment. your video did trick that 4 hours of lynda training could not do. Love your video bro
@derekbanas
@derekbanas 9 жыл бұрын
+Salim Kotadiya Thank you for the kind compliment :) I'm happy that you enjoyed it.
@Noble_1776
@Noble_1776 6 жыл бұрын
If you are interested in OOP I recommend looking into the SOLID principles and listening to uncle bob lectures. This channel also has a great section on design patterns that are a pretty cool thing to fill your developer tool box with ;)
@SkyrimBeast
@SkyrimBeast 7 жыл бұрын
I just had to sub once I heard Wordpress as that's what I mainly develop for. Thanks a lot Derek, much appreciated.
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) Most of my sites are WP sites as well
@dfence1985
@dfence1985 8 жыл бұрын
Actually Mark would be an instance of the class BlackManWithAFancyColoredSuit, which inherits from Man class :p
@derekbanas
@derekbanas 8 жыл бұрын
That's funny :)
@webleydevelopment
@webleydevelopment 8 жыл бұрын
Hi derek. Whats the real difference between the __get method and the getName() method? Arent they both getters??
@patrasculucian2403
@patrasculucian2403 6 жыл бұрын
20:00 - Another example of polymorphism is where we're going to be able to define functions that are going to be able to accept classes that extends a specific class or a specific interface I had to write this down man xD
@derekbanas
@derekbanas 6 жыл бұрын
Sorry if I made that to complicated. I try to use normal words most of the time
@7oktarini
@7oktarini 7 жыл бұрын
Thank you for the video Derek! May I ask what the difference is between interface and abstract class?
@derekbanas
@derekbanas 7 жыл бұрын
Abstract classes can have non-abstract methods. Interfaces have to have only abstract methods
@choglog
@choglog 10 жыл бұрын
Thank you for this, im going to chromecast this to my tv and watch it all with a cuppa, cheers
@derekbanas
@derekbanas 10 жыл бұрын
MultiSamster That's cool. Makes me feel almost like a movie star :)
@BULLSHXTYT
@BULLSHXTYT 10 жыл бұрын
Simple, easy to understand, all most power but you need to know are well stated
@janicejackson605
@janicejackson605 7 жыл бұрын
Nice video! Could you recommend me which PHP projects can I create in order to deepen my knowledge in OOP PHP?
@derekbanas
@derekbanas 7 жыл бұрын
Thank you :) Here are a couple www.w3resource.com/php-exercises/php-class-exercises.php
@janicejackson605
@janicejackson605 7 жыл бұрын
Thank you :)
@trucane3472
@trucane3472 9 жыл бұрын
When I try to echo animal_one-> id; I get a fatal error stating cannot access protected property Animal::id... am I the only one having this problem? class Animal { protected $name; protected $id; public static $_number_of_animals = 0; function __construct(){ $this->id = rand(100, 1000000); echo $this->id; Animal::$_number_of_animals++; } } $animal_one = new Animal(); $animal_one->name = " Spot "; echo $animal_one->name; echo $animal_one->id; 546584 Spot fatal error: cannot access protected property Animal::id...
@Roy-Vector3
@Roy-Vector3 9 жыл бұрын
TRU because id is protected, you need a getId() method that returns the id. weird thing is he also did $animal_one->id; but it worked, i'm confused about that.
@opdavies
@opdavies 9 жыл бұрын
+TRU You either need a getId() method to return the ID, or use the __get() magic method which is shown in the video.
@NetStorm84
@NetStorm84 9 жыл бұрын
+CrackKat It was the magic method of __get that allowed him to do that.
@ristekabranov3171
@ristekabranov3171 8 жыл бұрын
just make the atributes public, not protected and it will work like a charm
@kingcodetv185
@kingcodetv185 10 жыл бұрын
You should try Brackets an Open Source software from Adobe actively being contributed to by many people.
@superjen4850
@superjen4850 4 жыл бұрын
You forgot to realise the future of PHP and include a tutorial on traits for better PHP OOP
@matiasmiraglio6894
@matiasmiraglio6894 8 жыл бұрын
around minut 15:00, why is the function __destruct run if you don't call it?
@jesse98362
@jesse98362 8 жыл бұрын
This is actually VERY important, as web development hinges on the request cycle. At the end of a web request EVERYTHING is destroyed. Except what isn't: the db, session, cookies. But anything from the script that generated the request output is destroyed. Key concept, but one that takes a bit to really get.
@tchadrycki
@tchadrycki 10 жыл бұрын
Fantastic video! It would be awesome if you could cover databases, web services, and apps backed. Thank you
@derekbanas
@derekbanas 10 жыл бұрын
Tchadry I always planned on making a video like this for web services next. I may see if I can cover most everything about PHP and MySQL in one video
@bas3q
@bas3q 10 жыл бұрын
Derek Banas I think it would be very helpful to do this for web novices who would like to set up their own site and need something more advanced than just how to do HTML+CSS+PHP. I'm thinking more like a start-to-finish series on setting up your own site w/hosting, DB, scripts, cron jobs etc.
@derekbanas
@derekbanas 10 жыл бұрын
bas3q I'll cover SQL next
@bas3q
@bas3q 10 жыл бұрын
Derek Banas Sweet, thank you!
@alias40anon
@alias40anon 8 жыл бұрын
So I return in the issue on private and protected subclass. I dont want to repeat myself like in another video but as I see it again :) a private subclass can not inherit attributes of superclasses but a protected subclass can inherit?
@frankzvovu
@frankzvovu 8 жыл бұрын
Can classes even be defined as private or protected in php? I thought only methods and properties.. If that is indeed the case it wouldn't matter because the inheritance would be normal but the access to the inherited class would be limited to the namespace (protected) or the php "classfile" (private)... at least that's how it works in java (kind of)...
@Paretozen
@Paretozen 8 жыл бұрын
PHP does have a concept of namespaces, so if you use a framework that has a class with the same name in your application you could still maintain that classname via namespaces. However you cannot make a class private etc like you are used in C# namespaces for example, in which case another namespace(framework) would not be able to access/use the class that has a private/internal keyword. Maybe with PHP 7 and anonymous classes you could build a hacky solution that would emulate what you are used to in pure OOP languages, but I'm not well versed enough in the matter.
@coccoinomane
@coccoinomane 9 жыл бұрын
Thank you Derek for these great videos! I come from an academic context (astrophysics) where I used C and Fortran daily, and a bit of Python; I am now trying to broaden my programming skills in view of finding a job outside academia. Your tutorials are being really useful for this purpose. I now would like to read a PHP book. I see that you recommend Welling & Thomson. I am keen on buying it, but I am a little worried because I suspect that web development has evolved a lot since 2008. May I ask what are your thoughts concerning this issue? Thanks, Guido
@derekbanas
@derekbanas 9 жыл бұрын
***** You're very welcome :) Actually a great deal has changed in that frameworks are much more commonly used. I think that book is still great for basic understanding of PHP and MySQL though. I tend to use a framework called Laravel now instead of straight PHP.
@coccoinomane
@coccoinomane 9 жыл бұрын
Derek Banas Thank you for your prompt answer! I will buy the book, then. Now, thanks to you, I am also curious about Laravel :) If I may ask, at what point do you think it is wise to start learning about it? Would you suggest first I develop an extensive experience on PHP?
@derekbanas
@derekbanas 9 жыл бұрын
***** Frameworks are dramatically different. You can see that by looking at my Rails tutorial. They do a great deal of the work for you. It is always best to understand the base language first though.
@mgshahriar9509
@mgshahriar9509 6 жыл бұрын
I am a mad fan your videos. Thank you very much for your meritorious videos. and i want to know Did you make any wordpress theme development video ?
@derekbanas
@derekbanas 6 жыл бұрын
Thank you very much :) Yes I have a bunch of WP tutorials here www.newthinktank.com/videos/web-programming/wordpress-how-to/
@UCBCteam
@UCBCteam 10 жыл бұрын
Derek can you teach us mode rewriting (.htaccess file) stuff please I need to know that badly please
@derekbanas
@derekbanas 10 жыл бұрын
***** I'll see what I can do
@derekbanas
@derekbanas 10 жыл бұрын
BigDk Mcgee I don't watch tutorials that others on KZbin make, but I'm positive that they are very good because they are way more popular then I am :)
@LizardanNet
@LizardanNet 10 жыл бұрын
what would be the difference between using an abstract class or an interface?
@derekbanas
@derekbanas 10 жыл бұрын
LizardanNet An abstract class can have methods in it that are not abstract and have code in them. All methods in interfaces are abstract.
@LizardanNet
@LizardanNet 10 жыл бұрын
Derek Banas Thanks. Another difference, I think, would be that an Interface is used by using the keyword "iimplements" whereas the class with the keyword "extends"... right?
@derekbanas
@derekbanas 10 жыл бұрын
LizardanNet Yes that is true as well
@cwcfunclock2709
@cwcfunclock2709 5 жыл бұрын
Hi derek, How are you able to do almost all the programming languages? any tricks or tips? Please share with us
@derekbanas
@derekbanas 5 жыл бұрын
Hi, I use this software for long term memorization kzbin.info/www/bejne/a6bVho2LjNSHgtE and these study methods kzbin.info/www/bejne/jKHUiXabicuYZrs I hope they help :)
@scorlingonzalez9003
@scorlingonzalez9003 7 жыл бұрын
is this consider javascript when creating classes inside php scripts or is this an actual php function ???
@derekbanas
@derekbanas 7 жыл бұрын
This is all PHP
@scorlingonzalez9003
@scorlingonzalez9003 7 жыл бұрын
ok thank you very much for ur fast response
@imran_ashraf
@imran_ashraf 10 жыл бұрын
soo awesome Derek! Thank you :-) Love to see a longer more in-depth version of this? more OOP PHP please?
@derekbanas
@derekbanas 10 жыл бұрын
Imran Ashraf Thank you :) I'll be making PHP framework tutorials very soon. Laravel will come first.
@ShifterCZECH
@ShifterCZECH 10 жыл бұрын
Derek Banas You are awesome :) But sometimes I get confused, so I just have to learn more :)
@ozlemucar5196
@ozlemucar5196 6 жыл бұрын
If we are making a website using both javascript and php which one we should create the objects in?
@eduardfornes
@eduardfornes 9 жыл бұрын
Well done! Great tutorial: complete, yet condensed.
@derekbanas
@derekbanas 9 жыл бұрын
Eduard Fornés i Català Thank you :)
@daviddriver6339
@daviddriver6339 8 жыл бұрын
Im typically no dummy.. but I can not for the life of me grasp where I would use this in a traditional smaller site.. and even in a more complicated site, what the difference between this is and what I'd consider the typical idea of unique functions and using a database or arrays to store values. (Note this is coming from a beginner so maybe there are things I do see yet or understand the need for..) What am I missing? PS Ive done your PHP, mysql, and bootstrap videos and its gotten me to a surprisingly functional site for my simple purposes in a very short amount of time. Thank you for taking the time.
@derekbanas
@derekbanas 8 жыл бұрын
OOP concepts confuse everyone when they first see them. After a while it makes sense to model everything based on real world objects. PHP isn't the best language for learning OOP though and it is better to study them with a language like Java or Python and then apply them to PHP.
@daviddriver6339
@daviddriver6339 8 жыл бұрын
Derek Banas Thank you for taking the time to reply! Maybe this can easily help me understand.. If I DO find myself reusing code in my PHP files.. right now Im copy pasting and making small changes if needed.. that seems stupid to me already even as a beginner. But could this be solved by making functions... or should I take it all the way to OOP?
@derekbanas
@derekbanas 8 жыл бұрын
What you are looking for is called refactoring. Yes it largely revolves around OOP. It will definitely make your code more flexible and understandable.
@daviddriver6339
@daviddriver6339 8 жыл бұрын
Derek Banas Thank you. Starting your videos on the subject now. As a beginner the hardest part of all this for me is the fact that I dont know what I dont even know.
@derekbanas
@derekbanas 8 жыл бұрын
Stick with it and it will all of a sudden make sense
@drewpeer
@drewpeer 6 жыл бұрын
Best tutorial on this I've seen!
@derekbanas
@derekbanas 6 жыл бұрын
Thank you I'm happy it helped :)
@nigelnasis810
@nigelnasis810 8 жыл бұрын
I love this Tutorial. In a way if the person who is watching this already read some info about OOP PHP.
@derekbanas
@derekbanas 8 жыл бұрын
Thank you :) I'm glad it helped
PHP MySQL Tutorial
19:22
Derek Banas
Рет қаралды 677 М.
C# Full Course : C# Tutorial for Beginners
8:58:36
Derek Banas
Рет қаралды 491 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 700 М.
99.9% IMPOSSIBLE
00:24
STORROR
Рет қаралды 31 МЛН
黑天使只对C罗有感觉#short #angel #clown
00:39
Super Beauty team
Рет қаралды 36 МЛН
Golang Tutorial : Go Full Course
3:49:15
Derek Banas
Рет қаралды 272 М.
Rust Tutorial Full Course
2:35:11
Derek Banas
Рет қаралды 556 М.
Machine Learning Tutorial for Beginners
2:03:06
Derek Banas
Рет қаралды 55 М.
PostgreSQL Tutorial Full Course 2022
3:42:11
Derek Banas
Рет қаралды 317 М.
Microsoft Excel Tutorial for Beginners  | Full Course
4:56:59
Derek Banas
Рет қаралды 18 М.
Probability
46:55
Derek Banas
Рет қаралды 15 М.
Python for Data Science
1:10:58
Derek Banas
Рет қаралды 23 М.
.NET MAUI Tutorial Full Course
5:08:38
Derek Banas
Рет қаралды 78 М.
How to Write a Novel
1:12:01
Derek Banas
Рет қаралды 37 М.
TensorFlow Binary & Multi-class Classification
2:07:45
Derek Banas
Рет қаралды 11 М.