Loadmodel Using Other Parameter

Hi there,

I’m trying to return a model to a view but I want to record sorted by a column name that is not id.

So instead of $model=Property::model()->findByPk($id);

I want to find by ‘columnName’.

Is this possible?

Thanks in advance.



There are many ways to do that depending of what exactly you want to do

One of them: