How to display data from 10 different tables?

Hi Everyone,

I am learning YII framework which is very interesting. As I understood in yii… there will be one model for one table. But in my application I would like to display data from 10 different tables. And before display I have to do some calculations as well.

How can I achieve this task?

Could anyone please help me?

What kind of calculations?

You can do some calculation using CStatRelation, if it looks too difficoult you can simply use CSqlDataProvider: it provides data from a raw sql query (in wich you can freely do as join as you need).

Anyway I’d like to advice you to take a deep look to all properties of CDbCriteria: with it you can customize the sql generated for retrive data to accomplish nearly all possible query, allowing you to exploit all power of ActiveRecord for display data.

Hi Andy,

As per my requirement. I have to get amount field from different tables and add all those to display in the homepage.

I would like to know how to access different tables from view.

Thank you,