summaryrefslogtreecommitdiff
path: root/demos/quickstart/protected/pages/Controls/Samples/TCaptcha/Home.php
blob: f3b7dea2845a79ee6bd43deb2e329dddb1ae56d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<?php

class Home extends TPage
{
	public function onInit($param)
	{
		if(!$this->IsPostBack)
		{
			$this->CaptchaList->DataSource=range(0,63);
			$this->CaptchaList->dataBind();
		}
	}

	public function regenerateToken($sender,$param)
	{
		$this->Captcha->regenerateToken();
		$this->SubmitButton->Text="Submit";
	}

	public function buttonClicked($sender,$param)
	{
		if($this->IsValid)
			$sender->Text="You passed!";
	}
}