
Use PHP to Create an MVC Framework - Full Course
video description
Date: 2022-03-14
Comments and reviews: 10
Niels
Although a great tutorial for learning how to build a framework with PHP, there are some (in my opinion: major) concerns about your approach with OOP programming, like for example around 04:43:58 when you make a class 'BaseMiddelware.php' that class is abstract and only has 1 abstract method, so why don't use an interface? This was also no the first time, somewhere in the video you could also use an interface instead of a class.
And secondly, almost all your properties are public, and yes I understand with PHP being a dynamically typed language it is easy, to store the variables in a string array and dynamically get/set the value like that, you could still make the properties private (or at least protected) and use 1 global setter/getter per class and pass the name of the property as an extra parameter and get or set the value like that.
and last, although this might be subjective, your classes have very high coupling between them, which could probably also be improved.
EDIT:
I just want to say, even though I 'criticized' the OOP way, I still enjoyed this video, and would recommend it, I learned a lot. And tbh if you want to make a framework you should know enough about programming that you can improve the OOP aspects yourself if you want to.
reply
Although a great tutorial for learning how to build a framework with PHP, there are some (in my opinion: major) concerns about your approach with OOP programming, like for example around 04:43:58 when you make a class 'BaseMiddelware.php' that class is abstract and only has 1 abstract method, so why don't use an interface? This was also no the first time, somewhere in the video you could also use an interface instead of a class.
And secondly, almost all your properties are public, and yes I understand with PHP being a dynamically typed language it is easy, to store the variables in a string array and dynamically get/set the value like that, you could still make the properties private (or at least protected) and use 1 global setter/getter per class and pass the name of the property as an extra parameter and get or set the value like that.
and last, although this might be subjective, your classes have very high coupling between them, which could probably also be improved.
EDIT:
I just want to say, even though I 'criticized' the OOP way, I still enjoyed this video, and would recommend it, I learned a lot. And tbh if you want to make a framework you should know enough about programming that you can improve the OOP aspects yourself if you want to.
reply
GameTroll
I so appreciate you for this. I've always wanted to learn what it takes to create these frameworks. Your lesson here is hands down the best I've seen. Very informative, very thorough, I love that you even go to great lengths to explain every detail from the what and the why to the how it is done. I can't thank you enough. Perhaps some day, if you haven't already done it, you'll do one of these videos on creating a javascript framework like React, Vue, and Angular?!?!
reply
I so appreciate you for this. I've always wanted to learn what it takes to create these frameworks. Your lesson here is hands down the best I've seen. Very informative, very thorough, I love that you even go to great lengths to explain every detail from the what and the why to the how it is done. I can't thank you enough. Perhaps some day, if you haven't already done it, you'll do one of these videos on creating a javascript framework like React, Vue, and Angular?!?!
reply
Aurnob
public Router $router; is giving me error on core->Application.php class even when my php version is above 7.4, it is saying -Parse error: syntax error, unexpected 'Route' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in G:\phpm\core\Application.php on line 11-
reply
public Router $router; is giving me error on core->Application.php class even when my php version is above 7.4, it is saying -Parse error: syntax error, unexpected 'Route' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in G:\phpm\core\Application.php on line 11-
reply
Ti
Sanitize off front all request input is a bad idea when multi system access the DB. Because, you MUST sanitize exatly with the same process. Example : login with password. If you hash the password after sanitize, the hash maybe not be the same with an other sanitize process.
reply
Sanitize off front all request input is a bad idea when multi system access the DB. Because, you MUST sanitize exatly with the same process. Example : login with password. If you hash the password after sanitize, the hash maybe not be the same with an other sanitize process.
reply
Fajar
When we define a route in the form of, we cannot access the '1' or 'slug' parameter other than using the $ _GET global.-
We send Request and Response classes as parameters to the controller. Likewise how can we send this '1' or 'slug' parameter ?
reply
When we define a route in the form of, we cannot access the '1' or 'slug' parameter other than using the $ _GET global.-
We send Request and Response classes as parameters to the controller. Likewise how can we send this '1' or 'slug' parameter ?
reply
Mohamed
I feel better from learning this amazing video. but, I have got problem during this video, after one hour, I have got problem not support call_user_func() when use controllers(SiteController.php) in index.php and I don't use phpstrom but vscode.
reply
I feel better from learning this amazing video. but, I have got problem during this video, after one hour, I have got problem not support call_user_func() when use controllers(SiteController.php) in index.php and I don't use phpstrom but vscode.
reply
Chinonso
I can't thank you enough for this. Went through the whole 6 hours and now I have my own functional PHP framework, and was able to learn a lot of new concepts I had previously overlooked. This is handsdown the best tutrorial I've come across!
reply
I can't thank you enough for this. Went through the whole 6 hours and now I have my own functional PHP framework, and was able to learn a lot of new concepts I had previously overlooked. This is handsdown the best tutrorial I've come across!
reply
gz
Why load a third party dependency for ENV if its just to load the login data?
isnt including such a third party code not a security risk and overkill for such a simple function?
reply
Why load a third party dependency for ENV if its just to load the login data?
isnt including such a third party code not a security risk and overkill for such a simple function?
reply
Brian
I have a question. Why I use ob_start and ob_get_clean() and then when render view is nothing show, but when I replace return by print_r this show html content on web.
reply
I have a question. Why I use ob_start and ob_get_clean() and then when render view is nothing show, but when I replace return by print_r this show html content on web.
reply
Simone
Hello.-
If I have two different tables in the database (users and complete_profile), how do I insert the values --sent by the registration into both tables?
reply
Hello.-
If I have two different tables in the database (users and complete_profile), how do I insert the values --sent by the registration into both tables?
reply
Add a review, comment
Other channel videos















