I have a gridView in my program which it's data are populated with my ActiveRecord model.according to this answer I added some extra properties in my ActiveRecord to enable adding extra filtering column.
My queston is that is this a right way for doing such things.I mean adding some property which can not be matched with database table fields.
If not whcih approaches can be used in these scenarios?

有帮助吗?

解决方案

There's nothing bad with adding a property that doesn't match a database field. It's widely used approach and you can rely on it. Here's an example from yii wiki.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top