Tukkan
Tukkan

Reputation: 1625

CakePHP Data in Model as array not datatable

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

Answers (1)

Martin Bean
Martin Bean

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

Related Questions