Hi all.
I have a problem i would like to solve and appreciate any help
here it goes:
In my application i have two models: Project and User.
What im trying to do is when a user creates a project, i want to increment a property of the user createdProjects+1.
So, what i did was in the ProjectController:
public function actionCreate()
{
$modelProject = new Project;
$modelUser = User::model()->findByPk(Yii::app()->user->id);
//gets the model of the user Logged
...
if ($modelProject->validate())
{
$modelUser->createdProjects = $modelUser->createdProjects + 1;
$modelUser->save();
}
...
}
An Exception is thrown:
"CCaptchaValidator.action "captcha" is invalid. Unable to find such an action in the current controller."
in the line [color="#8B0000"]$modelUser->save()[/color] when i try to update the User counter.
What am i doing wrong?
Thank you for your time.