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

  Рет қаралды 7,835

Happy Developers

Happy Developers

Күн бұрын

Пікірлер: 14
@grantcarv
@grantcarv Жыл бұрын
one of the best video tutorial ever
@PwrSrg
@PwrSrg 3 жыл бұрын
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 (KZbin) developers are using to handle CRUD in Ci4! (Models VS Controllers)
@happydevelopers
@happydevelopers 3 жыл бұрын
Hello @Sergio and thanks for the feedback it is really valuable. The main feedback that I had was that the video was little too fast and that's why my next video (that is basically installing a CRUD for Codeigniter with grocery CRUD) is having a slower approach so people will understand the transitions. You can see the next video here: kzbin.info/www/bejne/nl6UomZ_ftl6Zqs If I want to be completely honest this video took me 2 months(!) to build it so I would prefer to publish it and get some feedback for the next video rather that go for perfect and never complete the video :) Now for your main question: In short I really wanted to show the MVC pattern and to organise our Model and Views a bit better. The Controller of course can be better and the way that I've used it at the tutorial could be simply better by having something like this: $blogModel->getBlogPosts(); Longer Answer: MVC is an old pattern and have some advantages and of course some disadvantages as well. The main advantage is that it is a well known and easy pattern so it is easy to work on a project with MVC structure. The downside however (from my personal experience) is that MVC pattern is tend you to have more of your code in your Controller. In order to avoid that on MVC you will need to go a deep further than just an MVC project. You should start thinking "Ok, now that I have separated my Model and my Views, how can I have a more organised Controller as well?". There are no quick answers to this question really. Some of the techniques that I use is to have libraries to do the heavy work (e.g. Grocery CRUD is one of them) so my Controllers will be simple and straight to the point. Others are to have a baseController that will do some heavy lifting (such as login checking,.... e.t.c.) and extending my controllers. Of course inheritance has advantages and disadvantages and that's something for another video maybe to cover :)
@doomhaMwx
@doomhaMwx 4 жыл бұрын
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.
@hobbyrider2
@hobbyrider2 4 жыл бұрын
awesome video series. plese next vidoe about database handling with codeignitor
@manideep_talampally
@manideep_talampally 4 жыл бұрын
Could you please do a video of login with google and Facebook
@diwakardayal954
@diwakardayal954 3 жыл бұрын
thanks alot keep it up
@doomhaMwx
@doomhaMwx 4 жыл бұрын
Thank you. I hope you could also do a video of inserting and updating data in the database, and if possible, with Ajax.
@gannonmalakai9706
@gannonmalakai9706 3 жыл бұрын
i realize I am kinda off topic but does anybody know a good website to stream new movies online ?
@beauisrael9724
@beauisrael9724 3 жыл бұрын
@Gannon Malakai i watch on Flixportal. You can find it by googling :)
@crosbyknox3818
@crosbyknox3818 3 жыл бұрын
@Beau Israel yea, have been watching on Flixportal for since april myself :D
@gannonmalakai9706
@gannonmalakai9706 3 жыл бұрын
@Beau Israel Thanks, I went there and it seems like they got a lot of movies there =) I appreciate it !
@beauisrael9724
@beauisrael9724 3 жыл бұрын
@Gannon Malakai You are welcome xD
Codeigniter 4 CRUD with Grocery CRUD | Tutorial Part 5
9:02
Happy Developers
Рет қаралды 11 М.
CodeIgniter 4 Tutorial - Simple Blog Part 1
38:48
Alex Lancer
Рет қаралды 87 М.
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 136 МЛН
Зу-зу Күлпаш 2. Интернет мошенник
40:13
ASTANATV Movie
Рет қаралды 540 М.
Send emails from a HTML Contact Form
12:40
Code with Ania Kubów
Рет қаралды 388 М.
#1. Introduction to CodeIgniter 4: Download and Installation Guide
13:32
Codeigniter 4 Impressions!
7:01
Happy Developers
Рет қаралды 47 М.
Think Fast, Talk Smart: Communication Techniques
58:20
Stanford Graduate School of Business
Рет қаралды 41 МЛН
Which is the best PHP Framework?
12:24
Happy Developers
Рет қаралды 114 М.
10 CSS Tips You NEED TO KNOW
8:43
Web Developete
Рет қаралды 849
TCP/IP for Programmers
3:03:31
Eli the Computer Guy
Рет қаралды 178 М.
Running With Bigger And Bigger Lunchlys
00:18
MrBeast
Рет қаралды 136 МЛН