Closed SimaWB closed 3 years ago
Under the situation of simply querying the database, you're right since in the CodeIgniter4, we can
use $model->builder()
to access to the Query Builder instance.
But in fact, our Datatables could be consists of more complex SQL Query. We might be able to use syntax like where or join or even different syntaxes.It's not that appropriate to write such complex logic in the Controller.
Considering this, I designed the example code like that.
It's not an issue but I don't know where to write:
CI 4 models have query builder. Therefore; I think your noticeTable function is unnecessary. We can use
$model->builder()
directly.