Codeigniter 4 MVC and how to create your first blog | Tutorial Part 4

preview_player
Показать описание
MVC pattern (Model View Controller) is one of the most confusing parts when you are starting using Codeigniter for the first time after working on simple PHP projects. That’s why at this tutorial we are going step by step learning MVC starting without even using Codeigniter just to understand some basics. On the other hand once you’ve learned it everything seems so easy and natural by using it.

At this tutorial we are focusing on examples of the MVC pattern and at the same time we are trying to have a complete blog in Codeigniter 4. It is very important also to not forget the Routes as it is the main file that is communicating with our Controller directly!

Timestamps:
0:00 Intro - What is MVC?
0:42 Simple PHP example (without Codeigniter)
4:14 Routes and Controllers in Codeigniter
9:23 Models in Codeigniter
12:10 Views in Codeigniter
15:00 Tidying up and complete our blog
17:14 Outro - Thank you! 🙏

Рекомендации по теме
Комментарии
Автор

awesome video series. plese next vidoe about database handling with codeignitor

hobbyrider
Автор

Could you please do a video of login with google and Facebook

manideep_talampally
Автор

Hi again. I came across CodeIgniter's query builder. It seems that using query builder is a bit different from what you did in this video, or are they just the same and is there a benefit of using one over the other? Been searching but can't find any answers. Thank you.

doomhaMwx
Автор

Hey Johnny, great video! LOVE the quick teaching style. (Though it gets a little TOO fast towards the end, and seems to start to skip over stuff.)

I have a question… At 2:35 you explain that the database functions (getPosts, getPost) should go in the Model, which is traditional MVC. BUT later when you convert it to CodeIgniter (viewAll, view), you put it ALL in the Controller instead! 🤔

Can you please explain WHY you do this? Is there an advantage to building it this way? I genuinely want to know WHICH is the better approach, and WHY.

Thanks!

PS - You mention doing "a special, separate tutorial just for the model". What would be GREAT would be a video comparing the pros and cons of ALL of the different approaches and techniques that (YouTube) developers are using to handle CRUD in Ci4! (Models VS Controllers)

PwrSrg
Автор

Thank you. I hope you could also do a video of inserting and updating data in the database, and if possible, with Ajax.

doomhaMwx
welcome to shbcf.ru