"Believe me, I prayed to God that you would do an explanation of OOP. When searching for an old course for you, I found that you have done it. Thank you. From Egypt, Alexandria."
Yet another fantasitc video, i've looked at a lot of other videos for learning PHP, in particular OOP and how I can apply what I already know with proceedule PHP and re-factoring my code into OOP. Your style of teaching is amazing and for me makes much more sense, thank you :-)
Glad to have you back on coding tutorials. Best RU-vidr out there for anyone who wants to learn about coding and security at the same time. I love mmtuts 😅
"Hi Dani, I trust you're doing well. I've been working on developing a PHP script and I want to ask you something. I'm interested in implementing a server-side activation mechanism to ensure that users need to interact with my website or server before the script can be fully activated and used. Additionally, I want to make it challenging for users to modify or bypass the activation mechanism and ensure that I have remote control over the activation process. Could you please provide guidance on how I can build such a mechanism? Specifically, I'm looking for advice on: 1. Implementing the activation logic within the PHP script. 2. Enhancing security measures to prevent unauthorized modifications or bypassing of the activation mechanism. 3. Establishing remote control over the activation process to enable/disable script functionality as needed. Thank you in advance for your help!
Nope. The purpose of the constructor is in principle to easily setup member variables. If you do this through setters, there's no need for a constructor.
Hello Dani, I learned to use the MVC model with your tutorials a couple of years ago, I appreciate everything you teach in your videos, there is something that I could never do on my own and I researched it a lot but I can't find a way to do it. Using OOP and MVC, how do I ensure that a function that performs an INSERT in the database returns the ID of that INSERT? I tried every way to use lastInsertId but it doesn't work for me. Could you give me a hand with that? thank you.
Why does everyone who shows OOP take the car's example? How tf should I use that on my website? I don't have cars in my HTML... Wouldn't it be better to show examples with DB connection? Text-areas? Other things? Why cars?
It's because you need to understand "how OOP works". You gotta learn to walk, before you learn to run. 🙂 "Everyone" shows the car example, because it's a great way for people to understand how OOP works. If we just started teaching our viewers "practical examples" immediately, then it would fly over 80% of peoples heads, and they wouldn't learn OOP properly... Also... I'm guessing you didn't finish my video before commenting, seeing you are asking "why we don't show stuff like DB connection" hehe... 😉 I understand that OOP can be frustrating, but I promise that everyone feel that way at the start, and eventually it will seem extremely easy compared to Procedural PHP. Just keep cool, and take things one at a time, and trust the process when "us teachers", decide that it is best to learn the car example when starting out. 😊
@@Dani_Krossing yes, but you can show starting examples with HTML DOM objects. Because we all use websites every day, and cars are real-life objects, so it is not truly helpful. And I am cool. Come on, I am learning OOP for free on Saturday, so that's awesome! 😁👍 I am just tired of the car's example. At least it could be girls...
I didn't understand OOP in my first language and i understand this so easily with you , The issue is not in the language or the difficulty of the topic or my mind. I think it is in the simplicity of the style and the conscience of the person who explains. Thank you for your great effort.❤❤❤
Excellent video. I pray that you will create a Laravel tutorial, and if it happens, I'm thrilled. Thank you once more for your tutorials, Dani. I gain a lot of knowledge. MABUHAY ka meaning I SALUTE you in filipino.
What kind of teacher you are ?! Thanks a lot for your efforts. Please make a Laravel Playlist if possible: It will be a fantastic journey for your subscribers and fans like me. (I sometimes click ads on your videos intentionally as a small sign of gratitude for what you are delivering. This is the minimum thing I can do :)
You're so good at explaining things! I'm really impressed. I'm switching to PHP for the job I applied for, and I'm hoping to learn it all in 12 hours. xD
Dani has a gift of making the difficult and challenging seem so easy. This is one of the, if not the best OOP tutorials on the planet. Thank you for sharing your knowledge in the subject area. Look forward to more tutorials.
I learned a lot from you, mmtut, back in 2016/17/18 when I started Web Development. Your tutorials helped me with all the fundamentals of designing website and building PHP websites. Even though I'm more of a JavaScript developer now, but I do miss your tutorials a lot. So happy to see your tutorial again. I'll definitely give some attention to PHP again so I'll build up my skills in PHP again and then move to Laravel. It would be great if you could do some advance tutorials on Laravel for PHP developers in your channel. Thank you so much for your tutorials and inspirations and all I learned from you. If I'm proud to be good in Web Development today, you helped set me up for who I'm today. Thank you and God bless you, Dani Crossing.
It’s because signupUser() needs to be accessed from a normal PHP file, when creating the object. 🙂 Protected we use, when only parent classes should have access to the method. So “a class accessing methods from another class”.
I'm so glad I found your page! You're helping a lot with your clear explanations. The best teachers are those who put themselves in the shoes of total beginners, and you're doing it so well.
you explained so clearly and to the point. thank you so much for sharing your knowledge. can you make a video to dive deeper into oop in php and Laravel? your Laravel tutorial is also very exceptional.
Good explanation sir. but i observed something from the setter and getter method you explained. wouldn't it be better if we set the brand first and then call the getter method afterward? Like this
48:36 incase somebody had the query fatal error it's because there's a typo in the sql query, just remove the single quote signs from around the table names from: ('username', 'pwd') to: (username, pwd)
I don't understand why this video has only 20k views. It's a free and great course. Maybe this language isn't that popular, and I made a mistake learning it. I hope I'm on the right web development path.
Why does my compiler not accept this attempt? It says dont use place holders on public functions. It's considered instantiating the same function again
The amount of code that OOP can save is very high when citing generic classes and inheriting to more specific classes. That being said, there is a maintenance price for inheritance and polymorphism.
I watched your video, tutorial, about OOP and for the first time everything, from 1st sec till the last is crystall clear and easy to understand. Hope you make more videos and tutorials. Thank you!
I finished this playlist, and I'm so glad. PHP is very much the same as Javascript and others; it's just different to write. Thank you so much for sharing the knowledge.
I couldn't possibly thank you enough for this video. The way nothing goes unsaid is remarkable in helping me understand every point without question! You are the best teacher I have come across yet!!
i wish u wouldve provided some better examples to which OOP is better suited. the sign up example that u provided is essentially procedural code inside an object, which seems redundant or like unnecessary complexity
Hey Dani! I wrote a series of codes years ago using functions instead of classes, and that's a habit I kept. In terms of speed (execution) which is the best route? Functions or Classes? Thanks for what you do!
Functions are faster because it involves less encapsulation, however you need to consider the purpose of your code rather than speed, when we talk about "when to use classes or functions". For example, if you need something like a login feature, then because of the scale/size of that feature, it is better off to use classes. However if you just need a simple feature to show the current time on your website, then it would be overkill to use classes. So it's not about "if you should use classes or functions". It's about "what tools best suits the task". 🙂 I see too many PHP developers argue about "Procedural vs OOP", and they all completely miss the point. It's like arguing about "if a screwdriver or a drill is the better tool", which is silly since they each have their uses.
@@Dani_Krossing Excellent. I basically use functions with APIs and Curl so I will not touch them then. I was asking about "execution speed" because I mostly interact with trading platforms, which require excecutions to be as minimal as possible :) Thanks again, Dani!
Always remember that a 'method' is not a function and it is written: function name(); You can see at a glance that it is NOT a function. I hope that is all clear now.
Polymorphism allows you to access derived methods from a base class. For example: class A { public function X() { return 10; }} class B extends A { public function X() { return 20; }} function f(A $object) { echo $object->X(); } $object = new B(); f($object); Without polymorphism, this would echo 10, because that's the implementation of X() in class A. With polymorphism, it will echo 20, because function f will understand that $object is of type B even though it is passed as type A. Under the hood, this is handled by adding a redirection table which contains pointers to the correct functions. Because of this redirection table, polymorphism is slightly slower. PHP uses polymorphism by default.
i am half way in this video so to speak i am at 31:32 and if you are a complete beginner to OOP and focus everything and listen to my master in PHP Mr Dani Krossing you my friend is no more a beginner in OOP. Thank you
Mission accomplished, the taskbar is full. 😂 I don't know how you don't get lost with all those icons. You can directly find apps from the start menu, press the flag key and type the first few letters and hit enter. 😉
In the futur you create tutorial for Laravel or Symfony for learn the next step in OOP PHP ? And thank's for you video :) It's perfect for understand the base of OOP simply. When a for advanced OOP ?
please do not advise me, I am trying to make bones for a character in unity with a PNG image in the skinning editor, but when I try to move with them or adjust the structure of the body in edit geometry, copying starts as soon as I press the mouse.
Hey! As i can see you get a desk that can adjust its height. Im beginning to study informatics and also im gaming alot and just wanted to ask you, if you could recommand a desk? Because also im moving out and im gonna get a fresh setup anyways :D Would you say those desks are worth their money?
Thank you so much! Making PHP easier. May I draw the conclusion; a login-systeem with OOP is safer way than with procedural PHP? Or just an other way to do it?
I love so much Danny. Thanks for your videos. We've been doing a lot of log in systems and Its almost like that's the only thing to do with PHP. Please can you do more projects with PHP this time