This is not about a specific framework, but as a whole.
The database is mainly used in the model, so I connect it in the designer of the parent model, and then use it in the heirs.
Is that right or not? And if not correctly, why?
updated
I wrote a little incomprehensibly, I apologize
In general, I call the static class $ db = $ db :: ini (); in the constructor of the parent model, in the models I use $ db-> sql ('query');
Connection settings are registered in the config.
Those. when I call $ db :: ini () then a connection to the database takes place using pdo and the pointer is saved to the $ db variable available in the model's derived classes
I watched yii, then some dude on the type forum said everything in the controller needs to be done, and the connection itself in the bootstrap, where the car is happening and the files are connected.
I think that I am doing the right thing, connecting to the database when I need it, because this is the model for that - am I right?