Анатолий
Новичок
Проблема с HTML_QuickForm::registerRule
	
	
	
		
И вот данный код выдает следующее сообщение:
Fatal error: Using $this when not in object context in z:\home\grad.loc\www\include\class.register.php on line 13
Помогите, пожалуйста! В чем проблема???
								
		PHP:
	
	class Register extends Content
{
	public $pin_code = 0;
	
	public function TestVal($val)
	{
		if ($this->pin_code == $val) return true; //Line 13
                     else return false;
	}
	public function __construct()
	{
		$oForm = new HTML_QuickForm('Register', 'post', '/'.$this->id.'/page.htm');
                 //<пропущено>
		$this->pin_code = substr(md5(rand(2, 99999999)), 0, 8);
		$oForm->addElement('hidden', 'pin', $this->pin_code);
		
		$oForm->addElement('static', '', 'PIN', $this->pin_code);
		$oForm->addElement('text', 'pin2', 'Подтверждение PIN:', $text_attr);
		$oForm->addElement('submit', 'submit', 'Регистрация >');
		
		$oForm->registerRule('TestVal', 'callback', 'TestVal', 'Register');
                  $oForm->addRule('pin2', 'Вы забыли ввести код подтверждения!', 'TestVal');
                  if ($oForm->validate()) {
			$m = array($this, 'Reg');
			$oForm->process($m, false);
			$this->result['form'] = null;
		} else {
			$this->result['form'] = $oForm->toHTML();
		}
	}
}Fatal error: Using $this when not in object context in z:\home\grad.loc\www\include\class.register.php on line 13
Помогите, пожалуйста! В чем проблема???
 
	            
 
 
		