Wiki articles in category Tips

The usual way to find out what Yii has created for an SQL query is to mutilate the SQL in the sourcecode and call the program again so that the SQL statement with errors is displayed. Or you can use the SQL logger, which must be switched on and off each time and logs all SQL statements, which leads to an enormous slowdown in program execution and decelerates your workflow.

Generally we need to show one or more fields from a model that is related to another model used in CGridView.
For our case we will use two related models, which explain how to use model "A" fields in a CGridView that used model "B".