gunnit
(Maric Gregor)
May 9, 2013, 3:55pm
1
Hello all and thanks for reading my post.
I set up the yii user extension and it works fine. I created a new table and i created a new relationship to the User table.
The User model is in the modules folder and not with all the other models.
When i try to use the relationship (eg ‘$data->user->username’) in my code i get the following error
include(Users.php): failed to open stream: No such file or directory
Anybody has an idea how i can solve this problem ?
jacmoe
(Jacob Moena)
May 9, 2013, 4:00pm
2
Even though the table is called ‘users’, the model is called User.
'user' => array(self::BELONGS_TO, 'User', 'user_id'),
[color="#006400 "]/* moved from General Discussion */ [/color]
gunnit
(Maric Gregor)
May 9, 2013, 4:04pm
3
jacmoe:
Even though the table is called ‘users’, the model is called User.
'user' => array(self::BELONGS_TO, 'User', 'user_id'),
[color="#006400 "]/* moved from General Discussion */ [/color]
so i should change the name of the relationship or of the file ? sry if i sound ignorant on the subject
jacmoe
(Jacob Moena)
May 9, 2013, 4:05pm
4
The relationsship - how does it look now?
gunnit
(Maric Gregor)
May 9, 2013, 11:06pm
5
‘user’ => array(self::BELONGS_TO, ‘Users’, ‘user_id’),
jacmoe
(Jacob Moena)
May 9, 2013, 11:10pm
6
It should be ‘User’.
The model is called ‘User’.
jacmoe
(Jacob Moena)
May 9, 2013, 11:12pm
7
IMO, they made a big mistake in choosing to name the User table ‘users’ …
That never ceases to produce problems…
gunnit
(Maric Gregor)
May 9, 2013, 11:17pm
8
Sweet , no wonder u an elite member :-), thanks solved it , sorry for a stupid question should have paid more attention , next time i will also post in the right place , have a good one
jacmoe
(Jacob Moena)
May 9, 2013, 11:22pm
9
You are welcome - and thanks
I do not move posts to punish people - I move them to try and create some order.