phpjsonyiiyii-cmodel

Rendering models using YII without a DB table


I'd like to render a list of results in a view which have been returned from an external API, rather than a database table.

It is possible to create temporary models for the data and display through a data provider?

The data is from Zoopla's API which restricts storing results in a database.


Solution

  • What you are after is known as Active Resource (especially if it is using REST). I would suggest you look at this extension, it does what you need: https://github.com/Haensel/ActiveResource