14. PHP autoload and php use namespace | Page edit | CMS OOP tutorial MVC

preview_player
Показать описание
Let's use php autoloader and how PHP use namespaces in this mini php namespaces tutorial. We will see how to include files automatically in a project, and also how namespaces can allow us to have multiple classes with same name, and how autoloading can figure out where to find our files.

Interested in learning real-life PHP design patterns?

➤ LINKS
(use tags to navigate between lessons)

Timestamps:
Intro (00:00)
CMS page edit (00:45)
Namespaces - explanation (17:49)
Namespaces - practical solution (22:47)
Homework (31:25)
Summary (33:33)
Рекомендации по теме
Комментарии
Автор

Because of tutorial i was able to understand namespace and autoloading. Thanks a lot for your tutorial.

arunkumark
Автор

Finally understood namespace. Thanks a lot.

raku
Автор

Sir thank you really appreciate you effort

jobayertuser
Автор

Great. Thanks! I'm looking for the way to create relationship between 2 tables in PHP MVC.

hochihuynh
Автор

I prefer the short video format with smaller examples rather than presenting this in a CMS (which I don't follow) as an example. I expected the use of Composer. Your videos are good, I'm giving my opinion because it was asked in the minute: 24:53

luizmeier
Автор

I like your voice, keep up the good work man! 👍

Автор

Hi, Thank you for the video. I am developing a good understanding of OOP when it is done correctly, but these videos are a bit too advanced for me. I was wondering if you could have a series w a simpler app that is geared toward beginners. Thank you

stimpressiondental
Автор

I do have a question about our setValue() function. As I understand, hardcoding and duplicating code is the enemy. On our setValue() function, why do we not use the following format,
public function setValues($object, $db_data) {
foreach ($db_data as $field_name => $field_value ) {
$object->$field_name = $field_value;
}
The field names are exactly the same as field names on our database, so why not just take those from the DB instead of hardcoding them under each entity class?

stimpressiondental
Автор

it is very unfortunate that every episode comes after a long time

msq