I have 3 tables that contain user information, one for students, one for teachers and one for administrators.
They are not related in any way. I wan't to create a dashboard for the Administrators, where a list of students and teachers shows up.
The only way I found to achieve this was using the $uses
variable in the Administrators controller. However, I have read in many places that this is bad practice.
Any solutions?
Another, perhaps better practice is the use of
ClassRegistry::init('MyModel')->myMethod()
(more reading @ Cake API)This only loads the object when it's used, as opposed to
loadModel
oruses
, withClassRegistry
the models are treated as singletons.--
There are plenty of conditions where you would need to access all of your models data, from one controller, but never a definitive answer on how to do it without breaking convention!