Searching over related models


hope someone can help me…

I have a table I have a model/table users and a model/table logins…

I want to make a search where I can search for example:

User.firstname begins with ‘E’, between January and February (at least one login in this time period).

To make such a search I have to make a relational search.

I have found this:

Can anyone tell me how I can make this with HAS MANY relations? At the moment I have done the thinks descripted in this wiki and I get a PHP Error:

include failed - include file not found - logins_search.php

I saw that he uses the string specified in this line

'logins_search', 'safe', 'on'=>'search'),

as filename. What does Yii expect here in this logins_search.php?



i think that your problem is in the model, in relation declaration.

For instance, if you have this:


'language' => array(self::BELONGS_TO, 'Languages', 'language_id'),


It will search Languages.php

Can you check your model?