Hi,
I’ve got the problem described below.
STRUCTURE
- Module user: [color="#4169E1"]protected/modules/user[/color]
- CActiveRecord Model [color="#4169E1"]protected/modules/user/models/User.php[/color]
- Module games: [color="#4169E1"]protected/modules/games[/color]
- CActiveRecord Model [color="#4169E1"]protected/modules/games/models/Game.php[/color]
RELATIONS
In the User Model, I’ve got this relation entry inside the relations() method:
'game' => array(self::HAS_ONE, 'Game', 'user_id'),
In the Game Model, I’ve got this relation entry inside the relations() method:
'user' => array(self::BELONGS_TO, 'User', 'user_id'),
PROBLEM
When trying to access:
$model->game->name
from my user’s views, I got the following error:
[color="#FF0000"]include(Game.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory[/color]
OK, I must correct the path, I thought. So I tried this:
'game' => array(self::HAS_ONE, 'application.modules.games.models.Game', 'user_id'),
but I received the same error:
[color="#FF0000"]include(application.modules.games.models.Game.php) [<a href=‘function.include’>function.include</a>]: failed to open stream: No such file or directory[/color]
What am I missing?
Bye,
Andrea