I have a model Adress and a model Person. Each person has an adress now I want to display the person and adress data in one CDetailView.
What I’ve tried is to use array_merge($person->attributes, $person->adress->attributes) but then I get the problem that one attribute of person is salutation which is stored with 0 => Mr. and 1 => Mrs. in the database. Therefore I’ve implemented a getSalutation-method which converts this database value to a readalbe value.
The $model->attributes oder $model->getAttributes() don’t call this special getSalutation() so what can I do?
your question is not clear , can you share some code, do u have the relationship b/w person and address if so, then you can solve your problem using relationship http://www.yiiframework.com/doc/guide/1.1/en/database.arr. But Please Clarify your questions.
and whey your are showing data in CDetailView b/c i assume there may be one-many relationship! one person have many addresses!!