I only have one question: HOW DO YOU INSTANTIATE MODELS? (anywhere in the project)
Old fashion way was $model = new Model(); where model could be in a totally different module and it would still work. How do we do this now? when I try to do it, it says: Class ‘app\modules\somemodule\controllers\Model’ not found which is funny because I want a model and it searches in controllers…
Nothing changed about it. If you need new fresh instance it’s just “new Post()”. If you need to get AR model with data it’s “Post::find->where(…)->one()”.
Tried it both ways and now it produces this: “Unable to find ‘app\modules\someModule\models\Model’ in file: C:\xampp\htdocs\site/modules/someModule/models/Model.php. Namespace missing?” either way that I’m going…