Answer the question
In order to leave comments, you need to log in
Is it necessary to use models when developing in CodeIgniter?
Good day!
I'm trying to master the CodeIgniter framework and develop a small application for myself and my project. In the process of reading the documentation, the question arose: is it necessary to use models in development? Or can you do without them?
Answer the question
In order to leave comments, you need to log in
You can extend the regular model and provide methods get($id), save($data), update($id, $data), delete($id) in it. Simplifies and speeds up the work on the project. How to expand is in the docks.
If it is PURE for yourself, you need to rivet something to make it work - you can do it without models and without CI.
But if the task is to "master the framework", then of course you should use best practice when developing, otherwise why master the framework incorrectly?
Models in Codeigniter are the saddest models I've ever seen, I don't know if they can be called that in the world of modern php.
Here is Eloquent (Laravel) Here are the models.
And in the codeigniter - just a class in which you add methods for working with the database.
++ My advice to you, CI is dead and will never be alive again, they released version 3.0 xs why.
Switch to a more popular framework (Laravel, Yii2 + a bunch of others).
CI is dead, don't touch the bones. Learn Yii.
If you really want CI, pay attention to Bonfire.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question