Call to a member function isAttributeRequired() on a non-object

Hello

I get this error:

Fatal error: Call to a member function isAttributeRequired() on a non-object in /var/www/yii/framework/web/helpers/CHtml.php on line 1146

after I added to my javascript file this line of code


window.location.replace(base_url+"/index.php?r=site/remove_user&id="+myid);

In my Site controller in action actionRemove_user I have this code


public function actionRemove_user()

	{

		Yii::app()->user->setReturnUrl('index.php?r=site/register');

		if(Yii::app()->user->getType() == 'admin')

		{

			$myid=htmlspecialchars($_GET['myid'],ENT_QUOTES);

			User::model()->deleteByPk($myid);

			$mymessage = "Користувача видалено";

			$usery = User::model()->findAll();	

			$this->render('register',array('model'=>$model,'mymessage'=>$mymessage, 'usery'=>$usery));

		}

		else

		{

			$this->redirect('index.php?r=site/login');

		}

	}

What is wrong?

You don’t assign any value to $model in actionRemove_user.

Thank you very much Mike for your hint.

Now it works. :)

hi, i got the same error

/var/www/yii/framework/web/helpers/CHtml.php

can you please help me out

Be more specific than that, please.