system
(system)
1
Wow - I really love this Yii
so to make sure i understand the blog tutorial – I started doing it again from the start
I am also following along the Video tutorial (great job!)
– in the video it seems that the user is created while in the protected directory
but
i get an error if i do that
so
i do it from the www/blog directory
then I enter this
$u - new user
$u->username='admin';
$u->password=md5('admin');
so far i get no error
but when i enter
$u->save();
i then get a FATAL ERROR
the first time itried this last week it worked
i am confused why this time it did not
any tips?
thank you in advance - i really would appreciate assistance, cause i want to be good at Yii
Ismael
(Shalanga)
2
FATAL ERROR is not enough to help you fix this problem.
Try in console mode retrieve some values.
Something like: $myModel->model()->findAll();
system
(system)
3
Hi,
Thanks for your assistance.
The exact ERROR message is this:
============================================================
Fatal Error: Call to undefined method stdClass::save() in C;\wamp\www\yii\framework\cli\commands\ShellCommand.php(139) : val()'d code on line 1
============================================================
any idea what is wrong?
it worked the first time I tried it last week
qiang
(Qiang Xue)
4
Are you sure you are calling $user->save() ? The error stdClass::save() means you are calling user::save().
system
(system)
6
i just exited the command line console
then restarted it again
then repeated the steps again
but no luck
same error
i'm determined to solve this
got my bottle of aspirin out
fully loaded
i think you will be the key to the solution - you seem to know your Yii
system
(system)
7
Quote
Are you sure you are calling $user->save() ? The error stdClass::save() means you are calling user::save().
i am in the blog directory – not in the blog/protected directory
which directory should i be in?
or does it matter?
Thanks
$u - new user
$u->username='admin';
$u->password=md5('admin');
It is supposed to be
$u = new user;
not
$u - new user
.
Try if this is the problem.