Reputation: 1625
I have some data to share in application but its not that much that I should use a database table. I was wondering, can I create an array in model and then from Controllers getting data form that array?
I have some types of users on website. These users sometimes have different main page (other modules) and I want to create an array $modules[userType][moduleArray];
Cheers
Upvotes: 0
Views: 459
Reputation: 39389
Absolutely. Take a look at the CakePHP cookbook entry on data sources. You’ll want to create a private property to hold your data, and implement the read/write methods to pop/push to your array as appropriate.
Upvotes: 1