Welcome Guest, Not a member yet? Register   Sign In
Moving from CI3 - 4
#2

(This post was last modified: 02-02-2020, 01:34 AM by littlej.)

Hello !

Here are some advices I would give you:
1/ I won't use things like "$this->uri->segment(3)", instead i would use routes definition: https://codeigniter4.github.io/userguide...aceholders
2/ I would use a model, yes. In CI3, I found it complicated, but in CI4 it is super easy: https://codeigniter4.github.io/userguide...your-model

So, I would use routes placeholders to manage incoming requests, create a "BeerModel" to interact with the database (and fetch the content), use the controller to manage all this and send the result to the view.

Please note that CI4 use a different way to load views: https://codeigniter4.github.io/userguide...ing-a-view
Reply


Messages In This Thread
Moving from CI3 - 4 - by danbriant - 02-02-2020, 12:54 AM
RE: Moving from CI3 - 4 - by littlej - 02-02-2020, 01:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB